player getting injured help please

Non-platform specific questions.

player getting injured help please

Postby j2graves » Sat Jan 05, 2008 9:24 am

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
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: player getting injured help please

Postby Bee-Ant » Sat Jan 05, 2008 10:06 am

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...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: player getting injured help please

Postby j2graves » Sat Jan 05, 2008 11:50 am

thanx! I was using something similar, but it wasn't working.
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: player getting injured help please

Postby Bee-Ant » Sat Jan 05, 2008 12:01 pm

You're welcome... :D
Maybe you have missed something :roll:
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron