sugarlabs / flappy

A python-pygame Flappy Bird clone
GNU General Public License v3.0
2 stars 12 forks source link

Update sugargame #27

Closed vaibhav-sangwan closed 8 months ago

vaibhav-sangwan commented 8 months ago

Pressing SPACE and UP keys to make the bird jump doesn't work and results in the following error being shown in logs:

Traceback (most recent call last):
  File "/home/vishu/Activities/flappy/sugargame/event.py", line 150, in _keydown_cb
    return self._keyevent(widget, event, pygame.KEYDOWN)
  File "/home/vishu/Activities/flappy/sugargame/event.py", line 191, in _keyevent
    mod = self._keymods()
  File "/home/vishu/Activities/flappy/sugargame/event.py", line 167, in _keymods
    mod |= self.__keystate[key_val] and mod_val
IndexError: list index out of range

The keys weren't mapped in the events.py file. I updated sugargame so that space-key-pressed and up-key-pressed events can be registered correctly. @chimosky , @quozl please review

chimosky commented 8 months ago

Reviewed, thanks!