GameMaker: Studio

GameMaker: Studio

Xem thông số:
Noname 30 Thg03, 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
< >
Đang hiển thị 1-1 trong 1 bình luận
Puppyguard 30 Thg03, 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)}
Lần sửa cuối bởi Puppyguard; 30 Thg03, 2015 @ 12:14pm
< >
Đang hiển thị 1-1 trong 1 bình luận
Mỗi trang: 1530 50

Ngày đăng: 30 Thg03, 2015 @ 7:08am
Bài viết: 1