hi,
i would to know if it’s possible to generate a variable with a text and a number ?
For example the variable level1 to make level1()
main.lua ---------------------- level = require "level" level1() local character = display.newCircle( 100, 100, 30 ) background.touch = function( event ) if event.phase == "began" then transition.to( character, {time=10, x=event.x, y=event.y} ) end end Runtime:addEventListener( "touch", background.touch) level.lua ----------------------------- function level1() background = display.newRect( 0, 0, 320, 480 ) background:setFillColor( 1, 0, 0 ) background.x=160 background.y=240 return background end function level2() background = display.newRect( 0, 0, 320, 480 ) background:setFillColor( 0, 1, 0 ) background.x=160 background.y=240 return background end return background
thanks for your response.