I have got so far in to my current project and only had a few errors and I came across a new one today. I get the error:
Runtime error
document path//game.lua:333 attempt to call method “rotate”
stack traceback
[c]: in function “rotate”
document path//game.lua:333 in function “updatemonster”
I have looked at the line that it says there is a problem and I cannot see any problem.
here is the code block that contains the error. I have highlighted the line 333 for you.
function updateMonster()
--if our monster is jumping then switch to the jumping animation
--if not keep playing the running animation
if(monster.isAlive == true) then
if(onGround) then
if(wasOnGround) then
else
monster:prepare("running")
monster:play()
end
else
monster:prepare("jumping")
monster:play()
end
if(monster.accel \> 0) then
monster.accel = monster.accel - 1
end
monster.y = monster.y - monster.accel
monster.y = monster.y - monster.gravity
else
----------------\>line of code with error----------------\>
monster:rotate(1)
end
--update the collisionRect to stay in front of the monster
collisionRect.y = monster.y
end
If someone could help me as I am so close to finishing.
Thanks
Ryan [import]uid: 111430 topic_id: 26728 reply_id: 326728[/import]