On this game im try to get he enemy to follow the player ONLY ON THE X AXIS. But i need it to be slower. Just so that the player can kill the enemy by jumping over.
Offline
X axis only:
forever if <(x position) < ([x position v] of [Player v])> //if player is on my right change x by [3] //change the 3 to change the speed else change x by [-3] //change the 3 to change the speed (again) end
Offline
Splodgey wrote:
X axis only:
forever if <(x position) < ([x position v] of [Player v])> //if player is on my right change x by [3] //change the 3 to change the speed else change x by [-3] //change the 3 to change the speed (again) end
or you could try this:
forever if<(x position) < ([x position v] of [Player v])> change [x velocity v] by [0.5] else change [x velocity v] by [-0.5] end set [x velocity v] to ((x velocity) * [0.95]) change x by (x velocity)that way the enemy uses velocities
Last edited by chipguy (2012-04-19 08:01:52)
Offline
Thank You So Muchhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Offline
chipguy wrote:
Splodgey wrote:
X axis only:
forever if <(x position) < ([x position v] of [Player v])> //if player is on my right change x by [3] //change the 3 to change the speed else change x by [-3] //change the 3 to change the speed (again) endor you could try this:
forever if <(x velocity) < (max speed)> if<(x position) < ([x position v] of [Player v])> change [x velocity v] by [0.5] //accelerates by changing x speed else change [x velocity v] by [-0.5] end end set [x velocity v] to ((x velocity) * [0.95]) //change the 0.95 to change how fast it slows down (the smaller the quicker) change x by (x velocity) //changes x by x speedthat way the enemy uses velocities![]()
I would have done that but I was trying to keep it simple. Also, I explained how to customize it and added a maximum speed
Offline
Just asking, how do i get it to die?
Offline
Rocket-Moon wrote:
Just asking, how do i get it to die?
There are 2 ways you could do this:
when i die death screen or whatever stop allor
repeat until <dead?> //use that instead of forever dead could be lives = 0 or something end death screen or whatever
Last edited by Splodgey (2012-04-20 02:14:58)
Offline