Page 1 of 1

player getting injured help please

PostPosted: Sat Jan 05, 2008 9:24 am
by j2graves
I want this to happen when my player actor touches an enemy or spikes etc.

1. he loses 10 coins
2. he changes animation
3. he changes transparency to half visible for 7 seconds
4. he loses one hit point
5. he becomes invincible to attack for 7 seconds

Re: player getting injured help please

PostPosted: Sat Jan 05, 2008 10:06 am
by Bee-Ant
1. Player>CollisionEvent>Enemy or Spikes
Code: Select all
coin-=10; //in this code, coin mean a variable
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);
CreateActor("CoinActor","CoinSprites",("none"),("none"),0,0,false);

2. Player>CollisionEvent>Enemy or Spikes
Code: Select all
ChangeAnimation("EventActor","PlayerHit",FORWARD);

3. Player>CollisionEvent>Enemy or Spikes
Code: Select all
transp=0.5;
CreateTimer("Recover", 7000 ms);

Timer>Recover>
Code: Select all
transp=0;
CanAttack=1;

4. Player>CollisionEvent>Enemy or Spikes
Code: Select all
power--;

5. Player>CollisionEvent>Enemy or Spikes
Code: Select all
CanAttack=0;
CreateTimer("Recover", 7000 ms);

Player>KeyDown>Attack Key
Code: Select all
if(CanAttack==1)
{
    //attack events
}


I think it's more than enough...

Re: player getting injured help please

PostPosted: Sat Jan 05, 2008 11:50 am
by j2graves
thanx! I was using something similar, but it wasn't working.

Re: player getting injured help please

PostPosted: Sat Jan 05, 2008 12:01 pm
by Bee-Ant
You're welcome... :D
Maybe you have missed something :roll: