Lol. The space you have for the topic title is SO TINY!
I couldn't really describe accurately my question, so I will do so now.
I am making a 2D Space Shooter game, and would like one of the
enemys to be able to fire at the player no matter where he is
positioned. I know how to make enemys fire projectile weapons,
and have often done so in my games.
But I don't know how to make the enemy fire at the player no
matter where he is positioned, and to keep the bullet on track,
and going in a straight line to its destination without moving from
side to side at all!
Like this,
Key
P = Player
E = enemy
- = bullet path
; = space
;P;;;;;;;;;;;;;;;;;;
;-;;;;;;;;;;;;;;;;;;
;;-;;;;;;;;;;;;;;;;
;;;-;;;;;;;;;;;;;;
;;;;E;;;;;;;;;;;
I want the enemys bullet to go in a straight line to the player.
;;;;;;;;;;;;;P
;;;;;;;;;;;;-;
;;;;;;;;;;;-;;
;;;;;;;;;;-;;;
;;;;;;;;;E;;;
No matter where the player might be positioned.
So how do I move the bullet in the right direction?
normally I would just use Bullet\x = Bullet\x + 1
or something like that.
But I need the bullet to be able to move in any direction!
If anyone could answer this, I would appreciate it.
WERDNA
I couldn't really describe accurately my question, so I will do so now.
I am making a 2D Space Shooter game, and would like one of the
enemys to be able to fire at the player no matter where he is
positioned. I know how to make enemys fire projectile weapons,
and have often done so in my games.
But I don't know how to make the enemy fire at the player no
matter where he is positioned, and to keep the bullet on track,
and going in a straight line to its destination without moving from
side to side at all!
Like this,
Key
P = Player
E = enemy
- = bullet path
; = space
;P;;;;;;;;;;;;;;;;;;
;-;;;;;;;;;;;;;;;;;;
;;-;;;;;;;;;;;;;;;;
;;;-;;;;;;;;;;;;;;
;;;;E;;;;;;;;;;;
I want the enemys bullet to go in a straight line to the player.
;;;;;;;;;;;;;P
;;;;;;;;;;;;-;
;;;;;;;;;;;-;;
;;;;;;;;;;-;;;
;;;;;;;;;E;;;
No matter where the player might be positioned.
So how do I move the bullet in the right direction?
normally I would just use Bullet\x = Bullet\x + 1
or something like that.
But I need the bullet to be able to move in any direction!
If anyone could answer this, I would appreciate it.
WERDNA