Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Game loop help.

Author
Message
Katz
18
Years of Service
User Offline
Joined: 26th Oct 2006
Location: Pensacola, FL
Posted: 6th Dec 2006 20:01
I am new to programming and have had a hard time understanding loops. I am trying to make a game that when my ELEMENT sprite collides with the END sprite you go to the next level. In the next level the back ground changes and the y position (ENDY) for the END sprite changes.

Any ideas, thoughts, hints and/or help will be greatly appreciated.




Thank you very much.

FNG
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Dec 2006 22:30
It's better to keep the loading of levels outside of the main loop because it can bog down the system if you're constantly loading the levels every loop. Loading only needs to happen once per new level.

In your program I made a load level function and made some other changes with remarks to explain why the change.

Katz
18
Years of Service
User Offline
Joined: 26th Oct 2006
Location: Pensacola, FL
Posted: 7th Dec 2006 03:00
Thank you so much and now I understand global variables and select and case. At least moor than I did. I need some direction with something else now. I want to make my sprite, the one I move (ELEMENT) bounce off of obstacles on the background and the border but I haven’t figured it out.

Attempted code to move my sprite around minus the border.


Code that makes fire move automatically.



Full Game Code


FNG

Login to post a reply

Server time is: 2024-11-27 01:57:18
Your offset time is: 2024-11-27 01:57:18