Making an Enemy
acousticriffer
Member Posts: 8
How do I make a enemy that starts off camera and will either try and always get to the main actor or move around in a random fashion? I'm also wondering how I can make my collision detection such that if any character were to leave the background, they would be stopped or bounced. Any help or direction would be greatly appreciated
Comments
OH!
I see!
Making them move towards the character's easy.
Make two integer variables - playerX and playerY
In your player character constrain the variable 'PlayerX' to the player's position.x and the variable 'Player Y' to the player's position.y.
On your enemy have the rule:
Move to position:
> PlayerX ^PlayerY
Hope that helps get you started!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
So in the main actor add the behavior
Collide with actor of type: Wall.
By wall I mean another actor. It isn't a keyword or anything.
I have my "background" actor. He is stretched to be about 1500x1500 for the whole level.
The way I have it now is that if the character goes off of the background, it restarts the scene, but I'm not liking that very much and would like to make it so that the character can't go off of the background at all. If i just do the collision between the character and the background, since the whole scene is based on the background, they immediately touch and the main character disappears. I need to somehow make a rule that constrains the main actor to the background
ideveloperz@googlemail.com