Hello i have little problem, and i don’t know how to fix this error…
-> main.lua:34: ‘=’ expected near 'local’
there are propably more errors
thanks to everyone who will help me with it.
[lua]— Made by wites, just test project–
local widget = require(“widget”)
display.setStatusBar(display.HiddenStatusBar)
local physics = require “physics”
physics.start()
physics.setGravity(0,0)
local tlo = display.newImage( “tlo.png” )
– position the image
tlo:translate( 100, 240 )
centerX = display.contentCenterX
centerY = display.contentCenterY
screenLeft = display.screenOriginX
screenWidth = display.contentWidth - screenLeft * 2
screenRight = screenLeft + screenWidth
screenTop = display.screenOriginY
screenHeight = display.contentHeight - screenTop * 2
screenBottom = screenTop + screenHeight
display.contentWidth = screenWidth
display.contentHeight = screenHeight
– ustawienia tla
tlo.x = centerX
tlo.y = centerY
tlo.width = screenWidth
tlo.height = screenHeight
tlo.isVisible = true
– funkcje –
local functions buttonTapped(event)
local id event.target.id
local function doButtons()
local optButton = widget.newButton { label=“Set Options”, onRelase=buttonTapped }
optButton.x = centerX
optButton.y = centerY
end
doButtons()
–doScroll()
function touchScreen(event)
if event.phase == “ended” then
transition.to(ball,{time=750, x=event.x, y=event.y})
end
end
function movebadball()
transition.to(badball,{time=1000, x=math.random(80,600), y=math.random(60,480), onComplete=movebadball})
end
movebadball()
function onCollision(event)
--print(“collide!”)
ball:removeSelf()
end
local ball = display.newImage(“ball.png”)
ball.x = 40
ball.y = 50
physics.addBody(ball, “dynamic”)
local badball = display.newImage(“badball.png”)
badball.x = 260
badball.y = 400
physics.addBody(badball, “static”)
Runtime:addEventListener(“touch”, touchScreen)
Runtime:addEventListener(“collision”, onCollision)[/lua]