• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED how to make enemy shot not toward the player but shut whene it clause and bettwen two angles

A

abde

Guest
hi i need do know how to make the enemy detecte if it s on the left or right of it and don t make that it shot derectly into the plr
( how to calculate angle)i got the bullet but i don t want theme to go toward to the plr
it can just shoot left or right.please respant i m not good at programing
 
Last edited by a moderator:
The x axis will tell you what side the player is on. If sign(x-player.x) is -1 the player is on the left. If it’s 1, the player is on the right. If it’s 0, the player and enemy are exactly equal in regards to x.
 
Top