PDA

View Full Version : Game Maker 6.1 help with bullets!


Devon Rose
09-02-2005, 05:18 PM
Hmm yes I beleive people already beat me to finding that program!
anyways I need help with one thing, how can I make it so when the player truns to a different side a different bullet comes out?

And I haven't been on in probably 4 years!

apiesandwich
09-02-2005, 07:47 PM
You can do it in many different ways really. Well at least a few. It can depend on the objects sprite, or a flag which you set whenever the player presses left or right, for example. check the platformer tutorial on the GM website.

Devon Rose
09-12-2005, 07:46 PM
Yes I was thinking of doing it one way, when player last pressed left key for example a left bullet will come out, but you see, It's 2 player and it complicates things, I could a left and right button for each player but that would decrease the gameplay. and thoes game maker examples prove usless I need 2 player examples.

pizza
09-13-2005, 07:43 AM
player step:
{
image_index = direction * image_number/8;
image_speed = 0;
}

If direction = 270
Create an instance of an object 'bullet_down'

and so on... :)

apiesandwich
09-13-2005, 05:27 PM
I could a left and right button for each player but that would decrease the gameplay.

Im not totally sure what you mean here.

Anyway, pizza is right about using the image, though Im just learning GML and am not sure what that peice of code means.

pizza
09-14-2005, 04:49 AM
the code (from gamemaker help) just means that sprite changes when direction changes...

apiesandwich
09-14-2005, 02:04 PM
I figured that but I didnt know HOW it did that. Actually I looked at it a bit more and Im pretty sure I get it.

Devon Rose
09-14-2005, 07:40 PM
I could a left and right button for each player but that would decrease the gameplay.

Im not totally sure what you mean here.

Anyway, pizza is right about using the image, though Im just learning GML and am not sure what that peice of code means.

well I meant you press 2 buttons for shooting
ex: 1 key = right bullet
2 key = left bullet
so instead of pressing just 1 button to shoot in 2 directions you press 2 buttons to shoot in 2 directions.

pizza
09-15-2005, 03:45 AM
and 4 buttons to shoot in 4 directions
:shock:

(useless indeed)

apiesandwich
09-16-2005, 12:47 PM
I still don't understand what you are saying. Why can you have it track the last direction pressed? If the two players are playing at once you must have a shoot button for each player anyway right?

Devon Rose
09-16-2005, 06:59 PM
Okay I put in caps so you understand better, I'm not angry or anything. PLAYER 1 PRESSES TAB TO SHOOT LEFT AND CTRL TO SHOOT RIGHT, PLAYER 2 PRESSES CAPS LOCK TO SHOOT LEFT AND ALT TO SHOOT RIGHT. make sense? It's very simple really 2 keys for each player to shoot in different directions. If you don't understand I can't really explain more vividly.

apiesandwich
09-16-2005, 07:31 PM
Ok I thought you were saying it was NOT like that. Ok well I will go away now.

ProtonACT
05-17-2006, 05:56 PM
this is the simple drag and drop way...

EVENT- (whatever button to shoot)

then...

-start a block (start of actions)
-purple octagon 'VAR'
variable- sprite_index
value- whichever sprite faces the way your shooting
operation- equal to
-create instance of object with motion
object- your bullet or w/e name
x and y- adjust so it comes out of where you want it to come out of
speed- how fast you want it to go
direction- if right 0
if left 180
if up 90
if down 270
etc
etc
etc
-End of actions


do that for each direction that you face

worked for me... hope i typed that right :)

Devon Rose
06-17-2006, 05:49 PM
I have abandoned this topic but... I have figured out how to use bullets WITHOUT programming... Gamemaker has little secrets and edges.