Actor help

Game Editor comments and discussion.

Postby DilloDude » Tue Jun 06, 2006 11:22 pm

What I would do is this: create a variable to represent your life stat: big, little, or dead. For example, call it lifestate. On your create actor, set lifestate to 1, or find out stats from the previous level so its 2. Now have you player actor, and add all animations. On events such as keydown, where you want to change the animation, instead of
Code: Select all
ChangeAnimation("Event Actor", "WalkRight", FORWARD);

or just a change animation event, put script editor with
Code: Select all
switch (lifestate)
{
    case 1:
    ChangeAnimation("Event Actor", "WalkLeftSmall", FORWARD);
    break;
   
    case 2:
    ChangeAnimation("Event Actor", WalkLeftBig", FORWARD);
    break;
...
}

You can add other stuff for other bonuses you can get, such as fireball.
On your collision with mushroom, set lifestate to 2 and change the animation to the animation required. (you might want to test any variables you are using for movement to change to the right animation). On a collision with an enemy (or anything that hurts)
Code: Select all
if (lifestate == 1)
{
    //the script you want when you die
}
else
{   
    //the script for changing animation to small
    lifestate = 1;
}

If you have any questions or problems, just ask.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest