so either I have the display.newImage declaration incorrect, i.e. it can’t find the image. Or I’ve done something else. The image is in the same directory as the main which the snippet below is from.
code snippet:
30 local cScale = 3
31 local coin = display.newImage(“Sprite_Star_Green_9.png”, 100, 100)
32 coin:translate(500, 800)
33 –or trying this, which doesn’t work either
34 –coin.y = 500
35 –coin.y = 800
36 –transition.to(coin, {x = coin.x, y = coin.y, xScale = cScale, yScale = cScale})
37 transition.to(coin, {xScale = cScale, yScale = cScale})
38 transition.blink(coin,{time = 1000})
error:
main.lua:32: attempt to index local ‘coin’ (a nil value)
message
stack traceback:
?: in function <?:205>
[C]: ?
\main.lua:32: in main chunk
Can someone please show me the error of my ways?