The problem that I am facing is with dealing damage to Nalfar. I tried all the numbers from 0.1 through 0.8 for “z” in the reflect method, no use. I successfully reflect it towards him, but zero damage.
Link to level (sub)
Here is my code:
# Use hero.reflect() to reflect back Nalfar's projectiles! while True: enemy = hero.findNearestEnemy() missile = hero.findEnemyMissiles() direction = Vector.normalize(Vector.subtract(enemy.pos, hero.pos)) if missile and hero.distanceTo(missile) < 5: hero.reflect(Vector(direction.x, direction.y, 0.5))