Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Screen is cleared and a new one appears Allegro5 in C?

Credits go to DanielH and Dizzy Egg for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
Screen is cleared and a new one appears Allegro5 in C?
Dizzy Egg
Member #10,824
March 2009
avatar

It's probably time to create a draw function, and draw different things depending on the state. Alternatively you could encode some characters in the string, and then have a function to print them as required. Probably easier for now, to just draw different things depending on the game state. In the attached source code, I have created a drawGame function, which is called every frame. I have put the first few states in for you (and removed them from the keypress/logic loop), to get you started....but there is a lot to move, so I'll leave the rest up to you!! :P

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

mayna azevedo
Member #20,077
May 2021

Wow, it's working perfectly. Thank you so much for everything, everyone!

I will finish this topic (finally), and I will start other projects using allegro.

But you were instrumental in helping me understand the basics and logic! Thank you very much!

 1   2 


Go to: