How to make things shoot

Game Editor comments and discussion.

How to make things shoot

Postby ESL » Mon Jun 28, 2010 2:09 am

I am a newbie here. Have read through the tutorials and watched the Space Invaders demo but am still having trouble making a spaceship to shoot. I am probably just missing one detail but not sure what it is. Are there any detailed instructions on how to do this?
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby DST » Mon Jun 28, 2010 4:07 am

Okay here's a quick vid i threw together for you of the *fastest* way to make this stuff happen.

Welcome to Game Editor!!!

It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: How to make things shoot

Postby GtcGaming » Mon Jun 28, 2010 5:57 am

if you don't get his video. I'll tell you how I do it


Creat actor name it PlayerShot than -add anaimation-look in their data/your pictures for the shot. Now make sure you set the "on startup" to off now

Go to your spaceship. add event - key pressed down - creat actor - PlayerShot

Now your spaceship will shoot.

To make it where it kills the enemy:

on your shot you made go to add event- collision- Destory actor "what ever your enemy is"

This should work, if it doesn't tell me and i'll see what's wrong.
GtcGaming
 
Posts: 18
Joined: Sat Jun 19, 2010 7:04 pm
Location: Oklahoma
Score: 0 Give a positive score

Re: How to make things shoot

Postby ESL » Tue Jun 29, 2010 2:59 am

Thanks to both of you. I understand how to do it now :wink:
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby ESL » Tue Jun 29, 2010 3:25 am

Well, sort of. Now it shoots once but the ship goes flying off screen too.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby ESL » Thu Jul 01, 2010 1:03 am

On the video, I had trouble reading the script code for the Enemy actor.

I wrote: xvelocity=-10;
//-is opposite of player shot's direction

but it looks like there are dots or quotation marks. I can't quite read them because the font color is light blue.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby GtcGaming » Thu Jul 01, 2010 3:43 am

Are you trying to get the enemy to shoot towards you? It should be yvelocity than. Y is for up and down and X is for side to side.

To make them move down you need to have them connected to "base_enemy" and have two sensors on both sides so if "enemy" touches it they will go "down" and "side to side"

I'm not sure how to do all this because I've been busy with learning c++.
GtcGaming
 
Posts: 18
Joined: Sat Jun 19, 2010 7:04 pm
Location: Oklahoma
Score: 0 Give a positive score

Re: How to make things shoot

Postby ESL » Fri Jul 02, 2010 2:39 am

Yes, I want the enemy to shoot back. On 2:12 through 2:26 of the video, he shows a script but I am having trouble reading it because of the font color.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby krenisis » Sat Jul 03, 2010 3:28 am

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

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
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: How to make things shoot

Postby Hblade » Sat Jul 03, 2010 4:57 am

How to make things shoot

If you would like to make things shoot, you should first open up Global Code

    Global Code:
      Click variables
      Click Add
      Name the variable bul_spd
      click where it says Integer, and select "Real"
      Click where it says Global Variable, and click Actor variable
      Click Okay

Close global code now, and go to your bullet actor. On the bullet actor, add this code

    Create Actor
      Script Editor
      Code: Select all
      bul_spd = 12;
      xvelocity+=bul_spd;

bul_spd is an actor variable, so it can be set for every actor separately. Now, go to your actor that shoots the bullet.
    Key down
      Shoot key (Which ever key you chose, we will use Z in this case)
      Create Actor - Bullet actor
      And you should be good :D

ENEMY BULLET:
Do the same thing as the first one, only use this code at create actor instead :)
Code: Select all
bul_spd = 12;
xvelocity = -bul_spd;

This will actually make it -12, instead of 12. Thus making a shot hurdle towards the character xD I hope this fixed your issue ^.^
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How to make things shoot

Postby ESL » Mon Jul 05, 2010 1:24 am

Thanks! This helps a lot.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby ESL » Wed Jul 07, 2010 2:05 am

I have the ship shooting but for the enemy ship, it says I have a script error




shottimer++;
if(shottimer==10)(CreateActor("planet_shot1", "shipShot", "(none)", "(none)", 0, 0, false);




shottimer=0;
>
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby Hblade » Wed Jul 07, 2010 2:19 am

use this not " ( " :D
Code: Select all
if (shottimer == 10)
{
    Create Actor - Do the rest
}
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How to make things shoot

Postby krenisis » Wed Jul 07, 2010 5:45 am

What complex coding we using here, for the enemy to shoot its very simple. Did you use the method I described?
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: How to make things shoot

Postby ESL » Thu Jul 08, 2010 4:06 am

I understand the concepts pretty well. I am just having trouble reading the light blue font scripts because my room has too much light. I will try it again tonight when I have a dark room.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Next

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron