Game Over

Talk about making games.

Postby ingsan » Sun Sep 26, 2004 10:35 am

Step-by-step instructions to put a code on a Helper actor

- Create an Actor. Call it " Helper".

- Place it off screen, so that it might never be seen in your game.

- On Helper :
on DrawActor event > Script, write :

    if (shipCounter == 0)
    {
    DestroyActor("yourMainactor");
    }

on DestroyActor ( of yourMainactor ) event > CreateActor ( yourMainactor ) action. Here you tell your main actor to reappear where you want :wink:
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 Oct 01, 2004 1:37 pm

INGSAN,

I am having a problem with all the different options that I see in the post. I have it set so when the actor gets hit and destroyed that a ship gets destroyed in the ship counter area. It also destroys the main player ship, but the ship was never created again. I tried it so when the main player ship gets hit it changes the visibility to disable and it never draws the ship again, but the actor is there because when I hit the key to fire the missile it fires. Here is what I am trying to do.

1. when player's ship is hit it disappears
2. if ships in ship area greater than 0 destroy one of the remaining ships. like the asteroid demo.
3. if ships in counter area is = 0 then loadgame("gameover.ged")

Once I have this figured out I will have no other issues except for when all aliens are dead it needs to loadgame("level2.ged").. But I am sure I can figure tha out.

"Game Editor, is there anything like it, (russian accent) I THINK NOT! (/russian accent)"
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby Just4Fun » Sat Oct 02, 2004 4:22 am

VYTIS_KNIGHT:
Below are two previous solutions that I posted on this thread. Didn't they work for your problems: 1 & 3?

"1. when player's ship is hit it disappears"

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

"3. if ships in counter area is = 0 then loadgame("gameover.ged") "

shipCount=shipCount-1; //decrement the counter
ships.textNumber=shipCount; //show the number on screen text
if(ships.textNumber ==0); //once the text is equal to 0
LoadGame("GameOver.ged"); //load a file
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 » Sat Oct 02, 2004 6:53 pm

Just4Fun,

Where do I setup the shipcount = 3 at the beggining?

Where do I put the following code on the bullet when it impacts the player or on the player?
if (shipCounter == 0) // or some other integer that you want to check
{
VisabilityState("playerShip",ENABLE); //make the player ship reappear. Use "DISABLE" to make it disappear.
}

Where do I put the following code and also I am not using a number counter I am displaying 3 small ships like the asteroid demo?
shipCount=shipCount-1; //decrement the counter
ships.textNumber=shipCount; //show the number on screen text
if(ships.textNumber ==0); //once the text is equal to 0
LoadGame("GameOver.ged"); //load a file

I need it destroy shipcount1, shipcount2, and shipcount3. If there are no more ships displayed loadgame("gameover").
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby Dark RyNo » Sun Feb 13, 2005 2:44 pm

I tryed to do it using this code.
Its basically the same as yours but on the final bit.
Destroy Actor
Script editor
if(Lives.textNumber<=0) {CreateActor("GameOver", "icon", "no parent", "no path", 0, 0, false);}/if 0 or less lives, create "Game Over"
if(Lives.textNumber>0) {CreateActor("Loselife", "icon", "no parent", "no path", 0, 0, false);}/if more than 0 lives, create "Lose Life"

It should work, but it doesnt. It just comes up with "Game Over" Every time.
Dark RyNo
 
Posts: 35
Joined: Tue Feb 08, 2005 7:04 pm
Score: 0 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron