I am a novice at Corona, and I’m trying to make it so that at random intervals between 1 and 3 seconds, little objects will appear above the screen and will have a linear velocity of 500 going downwards. However, the simulator just shows black and terminal says there was a syntax error: “function arguments expected near ‘=’”
Here is my code:
[code]
local physics = require(“physics”)
physics.start()
physics.setGravity( 0, 0 )
–Function to create objects up top
local ballSpawn = function()
local ball
ball = display.newImage( “button.png” )
ball.x = 40 + math.random( 380 ); ball.y = 0
physics.addBody( ball, { radius = 15 } )
ball:setLinearVelocity = 500
end
timer.performWithDelay( math.random( 1000, 3000 ), ballSpawn, 0 ) [import]uid: 82408 topic_id: 14452 reply_id: 314452[/import]