Discord
Login
Community
DARK THEME

how to make an AI to the enemy follow the player?

how to make an AI to the enemy follow the player, this is for my game ''ghost battle''

link of project for you look: https://microstudio.io/rianstar/ghostbattle/2024/

link of the publication: https://microstudio.io/rianstar/ghostbattle

or just look at my perfil, because the game is public(but incomplet)

thank you for the help<3

This might work for you: https://microstudio.dev/i/apinguen/ghostbattle/ (Added this code in the "redupdate() function"):

if ghost.x > red.x then red.x +=0.5 end

if ghost.x<red.x then red.x -=0.5 end

if ghost.y>red.y then red.y +=0.5 end

if ghost.y<red.y then red.y -=0.5 end

thank you toooooooooooooooooooooooooooo much apinguen, i love you:D

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community