V
VaygrEmpire
Guest
situation:
1. when enemy spawns, it flies toward player's position (doesn't change its direction even if player moves).
2. if in certain range, enemy starts to shoot at player for a few seconds.
3. enemy's bullet should not follow the player. However, it should keep flying based on obj_enemy's direction.
problem:
1. enemy's bullet follows the player
so far I was able to narrow the problem down to this level:
===================
direction = point_direction(obj_enemy_bf109e_yellow.x, obj_enemy_bf109e_yellow.y, x, y);
===================
the results seem to be satisfying. When the bullet is created, its direction looks ok. The thing is, if I set speed for this....it always head to right side of the map.
"move towards point" drop box also doesn't improve the situation. I set it as:
==========
x: x
y: y
speed: 10
==========
and still the same thing happens. if I set it as:
==========
x: obj_enemy_bf109e_yellow.x
y: obj_enemy_bf109e_yellow.y
speed: 10
==========
it flies toward opposite direction of the attachment.
How do I make enemy to fire bullets straight based on its flying direction?
Thanks for any help in advance!
1. when enemy spawns, it flies toward player's position (doesn't change its direction even if player moves).
2. if in certain range, enemy starts to shoot at player for a few seconds.
3. enemy's bullet should not follow the player. However, it should keep flying based on obj_enemy's direction.
problem:
1. enemy's bullet follows the player
so far I was able to narrow the problem down to this level:
===================
direction = point_direction(obj_enemy_bf109e_yellow.x, obj_enemy_bf109e_yellow.y, x, y);
===================
the results seem to be satisfying. When the bullet is created, its direction looks ok. The thing is, if I set speed for this....it always head to right side of the map.
"move towards point" drop box also doesn't improve the situation. I set it as:
==========
x: x
y: y
speed: 10
==========
and still the same thing happens. if I set it as:
==========
x: obj_enemy_bf109e_yellow.x
y: obj_enemy_bf109e_yellow.y
speed: 10
==========
it flies toward opposite direction of the attachment.
How do I make enemy to fire bullets straight based on its flying direction?
Thanks for any help in advance!
Attachments
-
349.1 KB Views: 14