Game Over

Talk about making games.

Game Over

Postby VYTIS_KNIGHT » Mon Sep 20, 2004 5:47 pm

1. How do I have it in a game that when all levels are completed or the player is out of ships that it displays GAME OVER? I have looked at all the demos and am a bit confused.
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby Just4Fun » Tue Sep 21, 2004 5:23 am

1. How do I have it in a game that when all levels are completed or the player is out of ships that it displays GAME OVER? I have looked at all the demos and am a bit confused.


Hmm. If I am understanding you correctly, one way to do this would be to use a global shipCounter to track the number of playerShips in the game(Use local variables to track the ships in each level.)

You could then decrement the global variable 'shipCounter' as each ship is destroyed.

shipCounter =10; shipCounter <=10; shipCounter=shipCounter -1;

When the last ship is destroyed, the shipCounter would = 0.

If the shipCounter = 0 then you could either clear your current screen and display your "Game Over" text or move the view to a different activation area to show your ending "Game Over screen.

Hths...
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby VYTIS_KNIGHT » Wed Sep 22, 2004 2:33 am

If the shipCounter = 0 then you could either clear your current screen and display your "Game Over" text or move the view to a different activation area to show your ending "Game Over screen.


Can I redirect it to a certain activation area on the main screen exe?

Example: the game has a main.exe and it loads each level1.dat, level2.dat, and so on. Can I have it go back to a certain activation area in main.exe or would it be better to create gameover.dat?
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby VYTIS_KNIGHT » Wed Sep 22, 2004 2:55 am

Also How can I write in the script editor the following?

if ships.textNumber > = 0 then ships.textNumber = ships.textnumber - 1;
if ships.textNumber = 0 then LoadGame("GameOver.ged")
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby Just4Fun » Wed Sep 22, 2004 3:14 am

Hi VYTIS:

Again, if I am understanding your question correctly: Yes. You could move to whatever Activation Region you want.

You could do something like:

if( shipCounter <= 0) //if the global shipCounter decrements to 0. Trigger the move to the Activation Region.
view.x = -1080 //the x coordinate of your "GameOver" activation region.
view.y = -160 //the y coordinate of your "GameOver" activation region.

Look at the demo that I posted called "Smiley Catch". It is a very simple demo that shows one way to deal with levels and movement to various Activation Regions. It uses level timers to control the amount of time a player has to play and the speed of the Smiley so it won't show you how to count your ships, but it will give you a pretty good idea of how Activation Region movement works. Hths
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby Just4Fun » Wed Sep 22, 2004 3:57 pm

Also How can I write in the script editor the following?

if ships.textNumber > = 0 then ships.textNumber = ships.textnumber - 1;
if ships.textNumber = 0 then LoadGame("GameOver.ged")



Once again, I think that you may be wrestling with variables.

You could define a variable to track the shipCount, and then, display the counter variable number in the textNumber. Finally, you could test the textNumber using the value stored in the shipCount variable.

shipCount=shipCount-1;
ships.textNumber=shipCount;
if(ships.textNumber = 0);
LoadGame("GameOver.ged");

Keep studying the tutorials and also the user demos. Jazz-e-bob has posted some good stuff. I learned a lot about timers from studying his code. I tried to heavily comment my demos and they usually deal primarily with one aspect of GE. ie Activation Regions, score keeping, timers, etc.

Once you get something together, please post a demo for us all to enjoy.

Peace....
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby VYTIS_KNIGHT » Fri Sep 24, 2004 1:51 am

I have it subtracting the ships that are left when the main ship gets destroyed. I have folled all the demos that I can, but I can not get the main ship to reappear. What are the steps needed? I followed the asteroids demo and have gotten this far, but I can not figure out how to have the main ship reappear after the counter ship has disappeared.

"GAME MAKER, who needs that?"
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby Just4Fun » Fri Sep 24, 2004 2:34 pm

Kool VYTIS:

It sounds like your are making progress in your game.

I am sorry, but I don't quite understand what you want to do next. Could you write the steps in psuedo code?

Like:

1. Create the actor.
2. Destroy the actor.
3. Add one to player score.
4. Draw the actor at a new random location.

Then maybe I will understand. Or, if someone else understands, please don't hesitate to jump right in... :lol:
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby VYTIS_KNIGHT » Fri Sep 24, 2004 3:13 pm

1. Actor gets hit buy enemy bullet.
2. Actor is destroyed.
3. Ship1(counter for lives) in upper part of screen is destroyed.
4. If lives greater than 0 create actor(ship/player). This is the part I am having problems with. I have studied Asteroids demo and could not get it to work in my game. I need to have it create actor(player/ship) if lives greater than 0.
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby ingsan » Fri Sep 24, 2004 5:06 pm

Hi Vytis !

Concerning this part of your problem :
    If lives greater than 0 create actor(ship/player). This is the part I am having problems with. I have studied Asteroids demo and could not get it to work in my game. I need to have it create actor(player/ship) if lives greater than 0

On which Actor have you written the CreateActor code (when your actor has to be re-created after Destruction) ? Is it on the actor itself or on another actor :?:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby VYTIS_KNIGHT » Fri Sep 24, 2004 5:09 pm

On the actor itself.
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby makslane » Sat Sep 25, 2004 12:00 am

Don't destroy the actor, just change your visibility state
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Sat Sep 25, 2004 9:29 am

Hi Vytis :)
The reason why your actor doesn't reappear is that it has been Destroyed.
So, any code that you put on him won't work as he NO LONGER exists in the scene.

Two things you can do to solve your problem :
:idea: Follow Maxslane's advice. Instead of DESTROYING your actor, just put a Visibility Action.
:idea: Or, put your code on ANOTHER ACTOR which is not seen in your game. Tell the latter that after Destruction, your main actor reappears.

I hope it works !
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby VYTIS_KNIGHT » Sun Sep 26, 2004 1:53 am

Can you give me a step by step instructions? What actor would I put the enable scripting on?
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby Just4Fun » Sun Sep 26, 2004 6:28 am

VYTIS:
Assuming that you are using Makslane's suggestion regarding using the Visibility function, and that your playerShip VisabilityState is DISABLED, you could simply test your previously created global counter (ie "shipCounter"):

if (shipCounter = 0) // or some other integer that you want to check
{
VisabilityState("playerShip",ENABLE); //make the player ship reappear.
}

Ingsan has mentioned a good tip: Sometimes it is easier and more efficient to create another actor off screen to take care of initialization,timing, counting, etc of a particular actor.

*Are you using the "variables/functions" popup list in the script editor? It is very useful at helping to complete scripts and also to learn the functions offered in GE. You can access the VisabilityState function from there and it will walk you through creating the script function for the editor... Hths......
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest