Tutorial make your actor shoot and the enemy shoot

Learn how to make certain types of games and use gameEditor.

Tutorial make your actor shoot and the enemy shoot

Postby krenisis » Sat Jul 10, 2010 11:33 pm

Ok to make your actor shoot 1st we need 2 actors
your player
bullet

Now we going to make the bullet go up the screen.
Ok click on the bullet/ click add/click draw actor/click add action/ click script editor/put this code/

yvelocity=-10;

click add immediate action action


Ok now click on your player//click add // click button down// hit spacebar and (disable repeat ) //click add action // click create actor//

On the small window for create actor choose your bullet actor then click add immediate action.
Thas it we are done with your actor now you can shoot bullets when you press space key.


Now for your enemy we need 2 actors
enemy
enemy bullet

Ok 1st click the enemy bullet actor
Click on add// click on draw actor // click on script editor //
yvelocity=+10;

that make the enemy shoot down at you!!!!

Ok now click on the enemy
click on add // click on create actor // click on create timer
a small windows pops up after you give it a name on the line below it type 250 . Now the go down to the line below that and erase the * symbol type 500. Now click on and go out of that.

Now for the last part click on the enemy again
click on add // click on timer // choose the timer you just made //
now add action // create actor // choose the enemy bullet and click ok

Now run you game and the enemies will be firing at you!!! enjoy

any question please ask and someone will assist you.
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby felix7991 » Thu Jul 22, 2010 3:20 am

Hello,

Thanx for the tutorial!

I was wondering if you know how to make the bullets to target your main actor?I've looked at some other peoples projects (GEForever), but am having trouble deciphering their methods and also being inexperienced with GE. Any pointers on how to implement an aimed bullet?

Cheers,
Felix
felix7991
 
Posts: 2
Joined: Thu Jul 22, 2010 3:15 am
Score: 0 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby jimmynewguy » Thu Jul 22, 2010 3:30 am

bullet->create actor->script editor
Code: Select all
angle=direction(x,y,player.x,player.y);//change player to the name of your main actor
directional_velocity=5;//5 is the speed of the bullet
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby felix7991 » Fri Jul 23, 2010 11:37 pm

Works great! Thanks for the help!
felix7991
 
Posts: 2
Joined: Thu Jul 22, 2010 3:15 am
Score: 0 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby krenisis » Sat Jul 24, 2010 3:57 pm

Thanks jimmy I was alseep whent this question was asked. Iam glad it helped you felix , welcome to the game editor. Make sure to check out all my tutorials, they help you get a solid foot on the ground.
Tutorial Database for all beginners click this link
viewtopic.php?f=4&t=8680
krenisis
 
Posts: 606
Joined: Sat Jul 25, 2009 3:27 pm
Score: 51 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby zxcvbnm » Fri Sep 03, 2010 5:23 am

Any more questions
Check out Momo AlienStarcatcher , featured in apples new and noteworthy and has 5 star reviews!!!
http://itunes.apple.com/us/app/momo-ali ... 61779?mt=8
zxcvbnm
 
Posts: 248
Joined: Sun Aug 22, 2010 7:57 pm
Score: 10 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby aamod » Fri Oct 11, 2013 10:59 am

how can we make a projectile motion

Such as throwing a bomb at any angle,etc.
aamod
 
Posts: 5
Joined: Tue Oct 08, 2013 3:28 pm
Score: 0 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby JaroodaGames » Fri Oct 11, 2013 4:56 pm

aamod wrote:how can we make a projectile motion

Such as throwing a bomb at any angle,etc.

Just add gravity to it;
Bomb -> Draw actor -> Script Editor
Code: Select all
yvelocity++;
User avatar
JaroodaGames
 
Posts: 56
Joined: Sun Jun 09, 2013 5:57 pm
Score: 2 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby aboukamikaz » Fri Nov 29, 2013 6:13 pm

Hey! i have a few questions concerning the shooting part of the game...
I am first wondering how can i make an ennemy shoot a bomb in an arc-like angle (first going up and left, let's say, and then slowly going down...) i tried your tip of adding gravity to it but it'd only work combined with an xvelocity code since the yvelocity is set for a gravity response... oh and i have trouble making the bullets hit the floor and explode :?
any answers would really help!!
And then,
I was wondering: how can i make my actor shoot left (when faccing left) or right (when facing right)...

Thanks for the help!!
aboukamikaz
 
Posts: 2
Joined: Fri Nov 29, 2013 1:33 am
Score: 0 Give a positive score

Re: Tutorial make your actor shoot and the enemy shoot

Postby skydereign » Sat Nov 30, 2013 7:43 am

aboukamikaz wrote:I am first wondering how can i make an ennemy shoot a bomb in an arc-like angle

Set its xvelocity to whatever value, and set its yvelocity to some negative value. In the bullet's draw actor, increase yvelocity.
aboukamikaz wrote:I was wondering: how can i make my actor shoot left (when faccing left) or right (when facing right)...

For this you need to have a variable to tell which direction your actor is facing. I'm going to call it dir. On the actor's move right event, set dir equal to zero. On the actor's move right, set dir equal to one. Now in the bullet's create actor event you can do this.
Code: Select all
if(dir==0) // player was facing right
{
    xvelocity = 10; // move right
}
else // player was facing left
{
    xvelocity = -10; // move left
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests