fusionengine-org/fusion

Fusion Engine 4.2 gives error upon key press detection

Closed this issue · 1 comments

The bug is an error with Fusion Engine:

Traceback (most recent call last):
  File "D:\Dot\game.py", line 191, in <module>
    movement_check()
  File "D:\Dot\game.py", line 12, in movement_check
    if engine.Key.key_down(engine.KEY_w) or engine.Key.key_down(engine.KEY_UP):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kivanc64bit\AppData\Roaming\Python\Python312\site-packages\fusionengine\events\event.py", line 13, in key_down
    return keys[self.key]
                ^^^^^^^^
AttributeError: 'int' object has no attribute 'key'

You need to add a key_down function to the loop.

It should've run, but it didn't.

This is what I expected to see:
expected

Windows 11 (10.0.26016, Win10 build 26016) w/ Fusion Engine 4.2.

Hi, I see your issue, but this is not an issue with fusion engine. Please read the docs better next time.
https://docs.fusion-engine.tech/v4/wiki/wiki/#keyboard-input