GameMaker: Studio

GameMaker: Studio

Vis statistikker:
Noname 30. mar. 2015 kl. 7:08
make the player only shoot when at ground
well can anyone help me? i have tried everything and it dont work :c
< >
Viser 1-1 af 1 kommentarer
Puppyguard 30. mar. 2015 kl. 12:12 
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)}
Sidst redigeret af Puppyguard; 30. mar. 2015 kl. 12:14
< >
Viser 1-1 af 1 kommentarer
Per side: 1530 50

Dato opslået: 30. mar. 2015 kl. 7:08
Indlæg: 1