K
K3ks3
Guest
So, my problem is that i wanted to destroy for example a bullet that i created with my keyboard_check(mb_left) and if that bullet hits a wall it destroys itself
everything is fine
but if there are more than two bullets every bullet gets destroyed.
Bullet Step event
Step Event player
I need help.
everything is fine
but if there are more than two bullets every bullet gets destroyed.
Bullet Step event
Code:
if (place_meeting(x , y, obj_wall_solid)) {
instance_destroy(obj_projectile);
}
In the Create Event for reference:
move_towards_point(mouse_x, mouse_y, bullet_speed);
// new code
var dir = point_direction(x, y, mouse_x, mouse_y);
image_angle = dir;
direction = dir;
Code:
// only shoot five times
if mouse_check_button(mb_left) and (instance_number(obj_projectile) < 5) {
instance_create(x, y, obj_projectile)
};