I have multiple slimes that crawl around and I want them to follow the player when they get in a certain range of him. I want them also to have minds of there own so they all don't do the same thing.
Well AI is a tough thing. The follow the player, you will want to use the Distance expression to check if the player is within a certain distance of slime, if so change the slime's actions.
Develop games in your browser. Powerful, performant & highly capable.
Give them a variable called state
Every x seconds change the state to random (walk left/right whatever)
if enemy is in x distance set state to follow / attack and so on :)
Thanks, but I still need help xD. I dont know how to do the state thing. When I name a variable it wont let me add a left and a right state.
You might want to start out going through the platformer beginner tutorial on the tutorials page. It's basics will really help out.
If you're going to have delays on actions, also set it as instance variable instead of the "Wait 1 seconds" condition. Guarantees each instance has their own timing.
eg:
Every Tick
Add 1*dt to Sprite.Time
if Sprite.Time=1
Subtract 1 from sprite time
Do actions.
would be awesome if someone posted an e.g of an enemy AI for a platformer