player flip horizontal based on the characters position
digitalzero
Member, BASIC Posts: 639
i need to find out how to always make my enemy actors face the player... its for a side scroller shooting game the hero actor controls the camera
Comments
Track the hero's xPosition in a game level attribute: heroX
Use the following rule in the enemy Actor:
@rthurman you always manage to save the day for me lol thanks so much! this code worked perfectly
You are welcome! Glad it will work for you.
@rthurman soooooo now im trying to track the distance between two actors... i know it has something to do with magnitude but i cant seem to find the tutorial and the one tshirt booth put up is private now
@digitalzero -- Distance would be: game.heroX-self.Position.X
okay @rthurman but check this out... lets say i have an enemy actor that shoots bullets but i want it to be about an inch away from each other and then spawn the actual bullet
Something like this:
There is a tutorial here if you care to check it out:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page