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 Over screen

Author
Message
Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 12th Jan 2007 23:13 Edited at: 13th Jan 2007 17:29
I have finally made a game (it's sorta like Galega). Only problem is that I can't get Game Over to go on the screen when I die. I have the loading screen working but i can't get game over to show up when the conditions are right.

sry, forgot to mention i have DBPro
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Jan 2007 23:34
code?

Pirates of Port Royale
Live the life of a pirate.
Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 12th Jan 2007 23:37 Edited at: 13th Jan 2007 01:48
Edit: Gone!
Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 13th Jan 2007 00:19
Oops. Code didn't work

Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 13th Jan 2007 03:26
anyone gonna help me?
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 13th Jan 2007 03:54
which part in that code sends you to game over? i don't see any game over coding in there

Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 13th Jan 2007 07:54
ok well somewhere in your code you need it to "goto GameOver" when the character died which deletes all the 3D media then shows the words GAME OVER and does whatever afterwards (exits restarts game or restarts level whatever you want it to do)

but i guess if you need more help just ask

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Jan 2007 10:13
One of the things you need to use are for/next loops. They are very helpful when you need to do the same command(s) many times.

Another useful command is "sync"... it allows you to take command of when the screen updates which gives you more speed (because it only updates the screen when you want it to) and allows you to do whatever you want to a screen before showing the player.

To show 2D on top of 3D you can use "draw to front" which allows you to create sprites or text (like the score) on top of any 3D objects.



I changed some of your code to use for/next loops. There are several other places you can replace many lines with a for/next loop. I'll leave those to you to play with.

Note: The "t" in the for/next loops is just a variable. It can be anything you want... just make sure that you end the for/next loop with "next yourvariable".

Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 13th Jan 2007 17:28


look at the last area of the code. That's what I've been trying to get it to do (display You Win! for 3 seconds then end the program) but all it does is stop everything, wait 4 seconds then close the program without showing anything.
Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 13th Jan 2007 21:01 Edited at: 13th Jan 2007 21:02
ty, it worked, but one last question
what does the next t command do?
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 13th Jan 2007 21:10
The next command means the end of the for loop. Like this:



The computer will execute everything between for and next 100 times, because I told the variable to start at 1 and keep going up until it reaches 100. Next means "make the variable go up by 1. If it's high enough, quit this loop. Otherwise, go back to the for and continue."

Quote: "Gimme teh code!"

Thank you for not flooding the forums with posts like this.
Allanon Shadeslayer
17
Years of Service
User Offline
Joined: 28th Dec 2006
Location:
Posted: 13th Jan 2007 21:14
Ty all! Now I know a whole lot more and should be able to use this info in other programs. Ty again!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Jan 2007 10:58
Quote: "look at the last area of the code. That's what I've been trying to get it to do (display You Win! for 3 seconds then end the program) but all it does is stop everything, wait 4 seconds then close the program without showing anything."


Oops... I guess I accidentally deleted that when I removed all the object collision checks.

It did work but because you didn't have "draw to front" you didn't see the text. It printed the text behind the 3D stuff.

@ Code Dragon

I'm sure you just didn't want to complicate it for him but he needs to know everything about for/next.


@ Allanon Shadeslayer

The default increment for "next" is 1 but if the for/next loop has a "step" in the command it increases by the number after "step".

Login to post a reply

Server time is: 2024-11-26 03:46:21
Your offset time is: 2024-11-26 03:46:21