GameMaker: Studio

GameMaker: Studio

View Stats:
Noname Mar 30, 2015 @ 7:08am
make the player only shoot when at ground
well can anyone help me? i have tried everything and it dont work :c
< >
Showing 1-1 of 1 comments
Puppyguard Mar 30, 2015 @ 12:12pm 
Maybe add
if place_meeting(x,y,Ground)
in the firing code?
for example if your firing code is something like this
if canfire = 1 && keyboard_check(ord("F")) {instance_create(x,y,obj_bullet)}
Then add
if place_meeting(x,y,Ground)
in like this
if canfire = 1 && keyboard_check(ord("F")) && place_meeting(x,y,Ground) {instance_create(x,y,obj_bullet)}
If you did this then you can only fire if you're touching the ground. I haven't tested this code so it might not work, in which case change the code like this:
if canfire = 1 && keyboard_check(ord("F")) && place_meeting(x,y+1,Ground) {instance_create(x,y,obj_bullet)}
Last edited by Puppyguard; Mar 30, 2015 @ 12:14pm
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: Mar 30, 2015 @ 7:08am
Posts: 1