I have this code :
local zombie={} function zombieTable( event ) for(int i=0;i\<10;i++){ table[i]=newSpriteSheet("leshy.png") table[i].life=5 } end local options = { --array of tables representing each frame (required) frames = { -- Frame 1 { --all parameters below are required for each frame x = 82, y = 1, width = 80, height = 110 }, -- Frame 2 { x = 1, y = 1, width = 80, height = 110 }, -- Frame 3 and so on... }, -- Optional parameters; used for scaled content support sheetContentWidth = 161, sheetContentHeight = 110 } local imageSheet = graphics.newImageSheet("leshy.png", options ) -- consecutive frames local sequenceData = { name="walking", start=1, count=2, time=750, loopCount = 0, -- Optional ; default is 0 (loop indefinitely) loopDirection = "forward" -- Optional ; values include "forward" or "bounce" } zombie = display.newSprite( imageSheet, sequenceData ) physics.addBody( zombie, "static", {density=3.0, friction=0.5, bounce=0.3, radius=12.5} ) zombie.xScale = -1 zombie:scale( 0.7, 0.7 ) zombie.x = 400 + 100 zombie.y = 280 zombie:play() transition.to( zombie, { x = zombie.x - 400, time = 8000, onComplete = function( self ) self:pause() end } ) --[[local zombie = display.newSprite( imageSheet, sequenceData ) zombie.xScale = -1 zombie.x = display.contentCenterX + 200 zombie.y = display.contentCenterY zombie:play() transition.to( zombie, { x = zombie.x - 400, time = 8000, onComplete = function( self ) self:pause() end } )]] Coins = 0 local centerX = 270 local centerY = 50 CoinsTxt = display.newText( "Coins: "..Coins, centerX, centerY, native.systemFontBold, 20 ) local options = { --array of tables representing each frame (required) frames = { -- Frame 1 { --all parameters below are required for each frame x = 82, y = 1, width = 80, height = 110 }, -- Frame 2 { x = 1, y = 1, width = 80, height = 110 }, -- Frame 3 and so on... }, -- Optional parameters; used for scaled content support sheetContentWidth = 161, sheetContentHeight = 110 } local imageSheet = graphics.newImageSheet("leshy.png", options ) -- consecutive frames local sequenceData = { name="walking", start=1, count=2, time=750, loopCount = 0, -- Optional ; default is 0 (loop indefinitely) loopDirection = "forward" -- Optional ; values include "forward" or "bounce" } zombie2 = display.newSprite( imageSheet, sequenceData ) physics.addBody( zombie2, "static", {density=3.0, friction=0.5, bounce=0.3, radius=12.5} ) zombie2.xScale = -1 zombie2:scale( 0.7, 0.7 ) zombie2.x = 400 + 100 zombie2.y = 280 zombie2:play() transition.to( zombie2, { x = zombie2.x - 400, time = 6000, onComplete = function( self ) self:pause() end } ) local options = { --array of tables representing each frame (required) frames = { -- Frame 1 { --all parameters below are required for each frame x = 82, y = 1, width = 80, height = 110 }, -- Frame 2 { x = 1, y = 1, width = 80, height = 110 }, -- Frame 3 and so on... }, -- Optional parameters; used for scaled content support sheetContentWidth = 161, sheetContentHeight = 110 } local imageSheet = graphics.newImageSheet("leshy.png", options ) -- consecutive frames local sequenceData = { name="walking", start=1, count=2, time=750, loopCount = 0, -- Optional ; default is 0 (loop indefinitely) loopDirection = "forward" -- Optional ; values include "forward" or "bounce" } zombie3 = display.newSprite( imageSheet, sequenceData ) physics.addBody( zombie3, "static", {density=3.0, friction=0.5, bounce=0.3, radius=12.5} ) zombie3.xScale = -1 zombie3:scale( 0.7, 0.7 ) zombie3.x = 400 + 100 zombie3.y = 280 zombie3:play() transition.to( zombie3, { x = zombie3.x - 400, time = 10000, onComplete = function( self ) self:pause() end } )
And I am getting this error :
game.lua:98: '\<name\>' expected near '('