Pages: 1
Topic closed
Here is a good script for enemies to follow your sprite.
Sprite x= any sprite
There should be a sensing bar that says "x position/y position of sprite x"
You dont need the variable to represent the sensing bar but her I couldnt find the matching sensing bar. Sorry!
<when green flag clicked>
<forever>
<glide( what ever you want )secs to x <{ x }> )y <{ y }> )
<end>
<when green flag clicked>
<set{ x }to( x positon of sprite x )
<set{ y }to( y position of sprite x )
Offline
This isn't a GOOD script, it's a very basic script that won't work in platform games.
Using the glide block is a very bad thing, because if you were on the other side of the screen, the enemy would get there as quickly as if it was right next to you. Using a point towards block with movement would give a more consistent AI, and platformer AI is a lot more complicated.
Offline
It's better, if you want that effect to do this:
<when green flag clicked>
<forever>
<point towards( you
<move( whatever amount you want )steps>
<end>
Because then you can actually run away.
If you want a platforming thing, look at archmage's AI tutorials.
Offline
That's impossible.
You do realize that by "whatever amount you want", I mean a number, right?
And that by "you", I mean whatever you want it to point to...
Right?
Offline
Then what's the problem?
Can you upload a project showing the problem?
Offline
Oh, nevermind.
Offline
Topic closed
Pages: 1