Hello guys im hoping somebody may be able to help with my problem.
I am creating a platform ninja game and I am currently trying to implement a throwing star. I have manged to get the star animated and to be created in front of the enemy who throws it. I have have also added force to the star which now hits my main player but the star is being spawned to many times, I need to limit the amount of stars the enemy can throw, any suggestions?
Kane Lakin
[code]
function enemyThrow()
local distance = math.abs( character.x - enemy.x)
if (distance > 50) then
ninjaThrow= movieclip.newAnim{“images/projectileA.png”,“images/projectileB.png”}
ninjaThrow.x = enemy.x
ninjaThrow.y = enemy.y
physics.addBody(ninjaThrow)
ninjaThrow:applyForce( 10, 0, ninjaThrow.x, ninjaThrow.y )
ninjaThrow:play()
end
end
[/code] [import]uid: 217352 topic_id: 35808 reply_id: 335808[/import]