Re: pyglet audiogame examples

I am going to experiment with both, but I am basically doing that, but in half the lines of code. I guess it may be a little more resource intensive as I am refreshing the dict each iteration of the loop, but not enough to matter...
I agree that the clarity of grouping all key_up code, all the tick code and all the key_down code is very easy to read, but there is no overlap or conflict in doing:
if actions['key'] == "space":
spk("Hello, I'm up")
elif actions['keyUp'] == "space":
spk("I am now up")
x += 1


There is conflict in screens, but when you group into screens like you said to do above, that removes having major screen conflict like:
if actions['key'] == "space" and screen == "start":
spk("Hello world")
elif actions['key'] == "space":
spk("This is space without anything")


But I don't know the advantage of having a class over a dict in this circumstance. You could group your code like:
def stuff(self, actions):
if actions['key']:
  self.key_down(actions['key'])
elif actions['keyUp']:
  self.key_up(actions['keyUp'])
self.tick()


I can easily create a format like this to test this style in pyaudiogame, so I'll do that and see what I think. But dicts are a lot more manageable in this circumstance than classes.


BTW, the developer of pyglet is looking for someone to take over development of pyglet...
And he is really
fed up with AVbin
He posted:
"""
Now that Pyglet seems to have been resurrected, perhaps someone would like to take the reins for Pyglet from me (see above link for more details).
I would be happy to add committers.  I would be even happier to transfer control of the entire project.  I'm really no longer involved except for as a distant observer wishing you guys well and cheering you on.
"""

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector

Reply via email to