Page 2 of 2

Re: Player Shooting on a Platform Game

PostPosted: Thu Nov 25, 2010 5:43 pm
by Bee-Ant
make another variable called "power"

Player -> Collision -> FireFlower :
Code: Select all
power=1;


Player -> Keydown -> Shoot :
Code: Select all
if(power==1)
{
    CreateActor("Shot","ShotAnimation","(none)","(none)",0,0,false);
}

Re: Player Shooting on a Platform Game

PostPosted: Fri Nov 26, 2010 1:11 am
by BloodRedDragon
Bloody hell Turon. You're not entirely sure how to make a player shoot a bullet and you've got more points than me.

Just goes to show how fair forums are doesnt it....

ONLY JOKING!!!! :P
To be fair you have posted more than I have....

Re: Player Shooting on a Platform Game

PostPosted: Fri Nov 26, 2010 8:16 am
by Turon
BloodDragy i did it! now all i need is Super Ostrich when he collides with the fire flower he will have an extra life can someone help?

Re: Player Shooting on a Platform Game

PostPosted: Fri Nov 26, 2010 8:24 am
by skydereign
Assuming you have a life variable already in your game, increase it by one upon collision.
Code: Select all
life++;


If you don't have one, create another variable, named life. You would use the following code to determine if the player should be destroyed when colliding with an enemy.
Player -> Collision with enemy -> Script Editor
Code: Select all
life--;
if(life<=0)
{
    DestroyActor("Event Actor");
}

Re: Player Shooting on a Platform Game

PostPosted: Fri Nov 26, 2010 9:23 am
by Bee-Ant
Turon wrote:now all i need is Super Ostrich when he collides with the fire flower he will have an extra life can someone help?

We just taught you on how to maintain variable to make powerups...
Yes still you can't maintain it to make lives???
Aren't them just the same??? :wink:

Re: Player Shooting on a Platform Game

PostPosted: Fri Dec 03, 2010 4:16 pm
by Turon
How do you loose one life and not 2 lives?

Re: Player Shooting on a Platform Game

PostPosted: Sat Dec 04, 2010 2:10 am
by Bee-Ant
Oh...it seems you set the Collision with Enemy to be repeated yes?
Restrict it then...make another variable called "colliding" and then edit the code to be :

Player-Collision-Enemy:
Code: Select all
if(colliding==0)
{
    life--;
    if(life<=0)DestroyActor("Event Actor");
    colliding=1;
}


Player-CollisionFinish-Enemy:
Code: Select all
colliding=0;

Re: Player Shooting on a Platform Game

PostPosted: Sat Dec 04, 2010 8:23 am
by lcl
Bee-Ant wrote:Oh...it seems you set the Collision with Enemy to be repeated yes?
Restrict it then...make another variable called "colliding" and then edit the code to be :

Player-Collision-Enemy:
Code: Select all
if(colliding==0)
{
    life--;
    if(life<=0)DestroyActor("Event Actor");
    colliding=1;
}


Player-CollisionFinish-Enemy:
Code: Select all
colliding=0;

:lol: way easier just to set repeat to no. :lol:

Re: Player Shooting on a Platform Game

PostPosted: Sat Dec 04, 2010 10:58 am
by Bee-Ant
lcl wrote::lol: way easier just to set repeat to no. :lol:

For some case, non-repeated collision doesn't work well...sometimes it won't detect the new collision made.
So it's better to use repeated collision with some restriction ;)

Re: Player Shooting on a Platform Game

PostPosted: Sat Dec 04, 2010 1:35 pm
by lcl
Bee-Ant wrote:
lcl wrote::lol: way easier just to set repeat to no. :lol:

For some case, non-repeated collision doesn't work well...sometimes it won't detect the new collision made.
So it's better to use repeated collision with some restriction ;)

Yeah. :D

Re: Player Shooting on a Platform Game

PostPosted: Sat Dec 04, 2010 10:34 pm
by BloodRedDragon
Glad you managed to fix it Turon. And whoever gave me a point..... thankyou?

Dont assume that for one second that was blatent grovelling