Quote:
Originally Posted by Jay Jennings
A few weeks ago I put together a video tutorial showing how you can do that in Corona:
Learning Corona w/Ghosts vs Monsters | Game Dev Nation
Okay, technically my example changes the Y coord and something goes up and down, but you could easily modify it to change the X coordinate for side to side movement.
Give it a shot and see if it helps you.
Jay
|
Hi Jay,
just been looking at your tutorial, has been a great help and you described everything great. But once I write the code for my animation the screen goes black so I know something is wrong but i can't find it! can you please help me?
my code so far is:
--> hide the status bar
display.setStatusBar(display.HiddenStatusBar)
--> add wooden block
local woodenblock = display.newImage("wooden_block.png")
woodenblock.x = 240
woodenblock.y = 188
--> block looping
local function woodenblockAnimation()
local animUp = function()
transition.to(wooden_block, { time=400, y=193, onComplete=woodenblockAnimation })
end
transition.to(wooden_block, { time=400, y=183, onComplete=animUp })
end
woodenblockAnimation()
all i want is my image to move from left to right at the top of the screen staying in the screen boundaries and looping constantly.. i know my y axis code is wrong for that but i just used this to get the animation working but i just get a black screen..
any advice would be much appreciated!
thanks