Newest version is
here...
Everything you should know should be in the .ged, and I don't think there's a tutorial for it yet (Might consider adding it if I have the time...) but if you can't open it, I'll explain what those do here as much as I can...
All the scripts I'll be showing is applied in...
Enemy -> Draw Actor -> Add Action -> Script Editor
- Code: Select all
angle = 0;//This will make the enemy move at an angle of 0, which is → (Right)
angle = 90;//Angle of 90, which is ↑ (Up)
angle = 180;//Angle of 180, which is ← (Left)
angle = 270;//Angle of 270, which is ↓ (Down)
With these angle codes, the enemy won't move, because you need to apply a directional velocity for the Enemy actor, add...
- Code: Select all
directional_velocity=12;
This will make Enemy move towards the angle at a velocity (speed) of 12.
Now there's a handy script I found from the game Asceroid which made me learn how angle is actually used to replace and customize MoveTo...
- Code: Select all
angle = direction(x,y,Player.x,Player.y);//This will make the actor Enemy follow the Player according to the player's x and y coordinates...
You can even customize it a lot more, like...
- Code: Select all
angle = -direction(x,y,Player.x,Player.y);//This will make Enemy flee from player.
Now for distance. Distance is also a very handy script...
- Code: Select all
if(distance(x,y,Player.x,Player.y)<100)
{
angle = direction(x,y,Player.x,Player.y);//Enemy will follow Player when the distance is 100 pixels or less from the player.
directional_velocity = 10;
}
else
{
directional_velocity = 0;//If Enemy is far enough from player, it will stop and wait until Player is within Enemy's range of 100 pixels.
}
I hope this helped.
EDIT: Minor spelling errors.
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.