Sunday, November 1, 2020

BPractice

  It was along and lonely road, but I have mamaged

to get a pause function on Flappy Bird. The code changes 

are below, affecting two functions: keysPressed() and update().

What made the difference: making the paused function global, so that

the update function knows what's what.



The game now ends normally with the escape key. If I press

pause, then everything stops. The game picks up again where

I left off when I press enter. 🎈Feels like a win!


                                    


One of the wins in this adventure, for me, was understanding that one

often goes with local files where possible, to save memory in a game.

Because some games can get pretty elabotate. The procedure I am

copying form is actually a best practice illustrating this...

No comments: