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 / Loop out of place... Is that even possible?

Author
Message
The Game Programmer
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sitting, and waiting, and staring, and..
Posted: 7th Feb 2005 09:58
Uh, well I've been trying to implement a wave of enemies into my game and I used arrays. Now after doing all the work typing everything in (while watching the superbowl making it yet more tedios) the code tells me that Loop is in the wrong place?! I actually have no idea what that means or how its possible so I'm posting up all my code.


I know its messy but please try to work through it, I am a newb after all.

Well, I'm trying aren't I.....

When Life gives you lemons make orange juice. Then sit back and wonder how it was done.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Feb 2005 10:15 Edited at: 7th Feb 2005 10:15
That is usually called by a loop of some kind not being closed. In this case it is at the frst of your loop right after the do command. This code can't be right.



You ar missing 2 next z commands. Also you need to use 2 different variable names when compound looping like that.

Use something like


The Game Programmer
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sitting, and waiting, and staring, and..
Posted: 7th Feb 2005 19:21
Ok, I actually had just forgotten to delete that code. Now its fixed, except whenever it compiles the screen just remains black, and doesn't generate anything on there... Any idea why?

Well, I'm trying aren't I.....

When Life gives you lemons make orange juice. Then sit back and wonder how it was done.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Feb 2005 19:35
I don't have the media so I can't run it. You may want to add this at the top though as you have a sync command in your loop but don't seem to be turning sync on.

sync on : sync rate 0

The Game Programmer
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sitting, and waiting, and staring, and..
Posted: 8th Feb 2005 05:10 Edited at: 8th Feb 2005 05:11
Ok, I looked through my code and I can't find anything, I'm posting up the most recent code and the media in a zip file.

Well, I'm trying aren't I.....

When Life gives you lemons make orange juice. Then sit back and wonder how it was done.

Attachments

Login to view attachments
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 8th Feb 2005 08:28 Edited at: 8th Feb 2005 08:29
Quote: "Also you need to use 2 different variable names when compound looping like that.

Use something like"



I was talking about this part of the code.


see how you have for z twice. It will be in a loop forever like that.
z will always be 22 at the end of the inner loop so the outer for z loop will continually start back at 21 on the next run and it will do this forever. Use 2 different variables in compound loops like this.



[edit] Also add this part right above the color backdrop 0 Like this


Login to post a reply

Server time is: 2024-09-23 11:28:11
Your offset time is: 2024-09-23 11:28:11