Player Shooting on a Platform Game

Game Editor comments and discussion.

Re: Player Shooting on a Platform Game

Postby Bee-Ant » Thu Nov 25, 2010 5:43 pm

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);
}
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 Shooting on a Platform Game

Postby BloodRedDragon » Fri Nov 26, 2010 1:11 am

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....
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Re: Player Shooting on a Platform Game

Postby Turon » Fri Nov 26, 2010 8:16 am

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?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Player Shooting on a Platform Game

Postby skydereign » Fri Nov 26, 2010 8:24 am

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");
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Player Shooting on a Platform Game

Postby Bee-Ant » Fri Nov 26, 2010 9:23 am

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:
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 Shooting on a Platform Game

Postby Turon » Fri Dec 03, 2010 4:16 pm

How do you loose one life and not 2 lives?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Player Shooting on a Platform Game

Postby Bee-Ant » Sat Dec 04, 2010 2:10 am

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;
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 Shooting on a Platform Game

Postby lcl » Sat Dec 04, 2010 8:23 am

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:
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Player Shooting on a Platform Game

Postby Bee-Ant » Sat Dec 04, 2010 10:58 am

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 ;)
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 Shooting on a Platform Game

Postby lcl » Sat Dec 04, 2010 1:35 pm

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
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Player Shooting on a Platform Game

Postby BloodRedDragon » Sat Dec 04, 2010 10:34 pm

Glad you managed to fix it Turon. And whoever gave me a point..... thankyou?

Dont assume that for one second that was blatent grovelling
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest