I know the answer to this, but its a bug that bit me and I wanted to share.
Runtime error
assertion failed!
stack traceback:
[C]: ?
[C]: in function 'assert'
?: in function 'getOrCreateTable'
?: in function 'addEventListener'
?: in function 'addEventListener'
...cle/Lua/My Game/y Game/level1.lua:195: in function <...cle game><br> ?: in function <?:215><br>
In my program I change my eventListener for enterFrame from moving the camera (think Mario Bros where you can move back and forth until you get to the end and you have to fight the level boss.
All was working well until changed some logic to determine if I was in the end level mode or not:<br>local attackMode = false<br><br>...<br><br>if onEndScreen then <br> attackMode = true<br>end<br>...<br><br>local function attackMode()<br>... do stuff<br>end<br><br>...<br>...<br>attackMode = true<br><br>Runtime:addEventListener("enterFrame", attackMode)<br>
The moral of the story is you CANNOT use a variable name as a variable AND a function.
Once I added in the flag variable “attackMode” it overwrote my function “attackMode” that did the work.
[import]uid: 19626 topic_id: 18993 reply_id: 318993[/import] </…cle>

