Shooting Both Ways

advertisement
Shooting Both Ways
Like I always say you can either use a previous game or
just make a new game. Get ready to learn another step into
Game Making.
Start out by making your player and after your done, make
sure you name it PlayerR or PlayerL which ever way the
player is pointing. Next, copy your player sprite and then
make a new sprite and paste your player sprite so you’ll
have 2 player sprites, but make sure you flip it horizontal.
Now call this sprite either PlayerR or PlayerL which ever
way the sprite is pointing. The sprite will be opposite of the
other .
Now make a bullet sprite doesn’t really matter how it
looks, but it is your sprite.
Make the bullet and only one of the players an object.
Double-Click the player and do these steps.
Now add the keyboard event as shown in the image
Now pick the Left event.
In the keyboard<left> event click the icon that looks like
the one in the image.
:
X= -4
Y= 0
Check relative box
Now add the icon that looks like the one in this image.
:
X= -4
Y= 0
Check relative box
Last thing to do on the keyboard<left> event is to add the
icon that looks like this.
:
sprite= PlayerL
That’s all you need to do on this.
Now add the keyboard<right> event and start out by
putting in these icons.
:
X= 4
Y= 0
Check relative box
:
X= 4
Y= 0
Check relative box
:
sprite= PlayerR
That is all you need to do on this.
Now add one more event and your done.
Add the shoot button mine is the spacebar just click the
keyboard<whatever>
Here is the more difficult part so please pay close attention.
Add these icons to the attack button event.
:
variable= sprite_index
value= PlayerR
operation= equal to
start block
:
object= bullet
X= 15
Y= -20
Speed= 3
Direction= 360
start block
:
variable= sprite_index
value= PlayerL
operation= equal to
start block
:
object= bullet
X= -15
Y= -20
Speed= 3
Direction= 180
end block
you should have this event
looking like the image below
Now you have just learned how to shoot both ways with
one button. Any questions just contact me at
jared_88.1@hotmail.com
Download