Hey guys! so ive ran into a problem that cant seem to figure out… so when i start the game it gives me an error saying…
Runtime error ?:0: attempt to call method 'respondsToEvent' (a nil value) stack traceback: ?: in function 'addEventListener' c:\users\ruvim\documents\main game\faller\game.lua:80: in function '\_lis tener' ?: in function \<?:141\> ?: in function \<?:221\>
and heres the code and where its giving the error
local spawnCircles = function() local Fall = math.random(display.contentWidth \* 0.2, display.contentWidth \* 0.8) circle[bCircle] = display.newImageRect("circle.png", 31, 31 ) circle[bCircle].x = Fall circle[bCircle].y = -70 physics.addBody( circle[bCircle], "dynamic", {bounce = 0} ) physics.setGravity( 0, 0.5) circle[bCircle].collision = onCollision circle[bCircle].addEventListener( "collision", circle[bCircle] ) \<------ line 80!! circle[bCircle].value = bCircle bCircle = bCircle + 1 end box.collision = onCollision circleTimer = timer.performWithDelay( 1000, spawnCircles, -1 )
SideNote - @roaminggamer - if you end up helping me hope the code i posted is more clear and easy to read
if not please tell me what to fix…
SideNote2 - when i comment out line 80 everything works perfect except the collision that i want doesnt happen…
thanks for any help 