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 / seccond level

Author
Message
theSPACEmafia
13
Years of Service
User Offline
Joined: 5th Jan 2011
Location: somewherez majikalz
Posted: 2nd Feb 2012 18:27
i am having an issue with adding a second level to a maze game i am making pleas help
the issue is that when i add a second loop nothing but the collisions disappear

i cheated in a second level but i want it to be able to have different levels

tsm
theSPACEmafia
13
Years of Service
User Offline
Joined: 5th Jan 2011
Location: somewherez majikalz
Posted: 2nd Feb 2012 18:29
oops forgot to click email box thats why this is here

tsm
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Feb 2012 01:52
Whoah! I think you had better learn about the for loop before progressing. Instead of this:



You could have this:


Not to mean any offense or disrespect but before taking on the challenge of adding more levels, you may need to learn a bit more about structuring your program. This is a good read.

theSPACEmafia
13
Years of Service
User Offline
Joined: 5th Jan 2011
Location: somewherez majikalz
Posted: 3rd Feb 2012 03:35
thanks for the tip no offence taken

tsm
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Feb 2012 12:03
I think I should answer your question though, for future reference.

You may know by now that there is more than one way to program something so I'll explain how I go from level to level.

Firstly, each level I plan to make will have a 'Level Preparation' function which basically prepares the program specifically for that level. This includes hiding/deleting sprites, images, sounds from previous levels (or the menu) and then loading, creating, and position sprites, sounds etc which will be used in the current level.

Once that is done, I then have another function which is called inside a Do-Loop. All of the action takes place inside this function e.g collision and movement.

Finally, I'll have a 'level clean up' function which will delete/hide eveything from that level. This allows the next level to load without any left over sprites, images, sounds etc.

I hope that makes sense and that you'll be able to make use of it.

theSPACEmafia
13
Years of Service
User Offline
Joined: 5th Jan 2011
Location: somewherez majikalz
Posted: 3rd Feb 2012 21:34
I tried to do the for loop but the program moved the starting cube to the goal and so I put it back and thanks for the tip about adding a second level, the for loop came in handy there thanks again Hodgey

tsm
theSPACEmafia
13
Years of Service
User Offline
Joined: 5th Jan 2011
Location: somewherez majikalz
Posted: 14th Feb 2012 20:06
i got it working thanks for the help your service is much appreciated

tsm
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 15th Feb 2012 02:35
Good to hear you got it working, well done.

Login to post a reply

Server time is: 2024-11-23 22:42:29
Your offset time is: 2024-11-23 22:42:29