lithekod / snake-ribs

A simple python code skeletons for making games.
MIT License
0 stars 2 forks source link

Input and main game loop #1

Closed FredTheDino closed 4 years ago

FredTheDino commented 4 years ago

The basic plumming of the code skeleton. Handling input events and doing basic input things, in a very clear way.

FredTheDino commented 4 years ago

If we're going to have this war on global state and global variables. What do you think of the sets: "current_frame_held_buttons", and "last_frame_held_buttons"? Is the cost just to great there to not have global variabels, or would something else be cleaner or easier to read?

I don't personally agree with the statement "all global variables are bad, avoid them like the plauge".

TheZoq2 commented 4 years ago

I think they should be inputs and outputs from the process_events function

TheZoq2 commented 4 years ago

And globals aren't all bad, but use them when they don't belong and things can go horribly. So it's best to not encourage them before people know not to abuse them imo

FredTheDino commented 4 years ago

Still waiting for those approves BTW.