Hey I know Corona is in Holiday Break but when you guys come back I would like some help in moving a platform across the screen like the game Platform Runner. [import]uid: 17058 topic_id: 19664 reply_id: 319664[/import]
like this? i dont know about Platform Runner:
[lua] local function move()
local function left()
local trans2 = transition.to(teeth, {time=3000, y = 50, onComplete = move})
end
local trans1 = transition.to(teeth, {time = 3000, y = display.contentHeight - 50, onComplete = left})
end
move()
[/lua] [import]uid: 16142 topic_id: 19664 reply_id: 75983[/import]
@darkconsole no what I mean is having platforms move across the screen the x-axis of the screen and then recycling itself, and appearing again but in a random position.
But if this confusing then tell me [import]uid: 17058 topic_id: 19664 reply_id: 75985[/import]
maybe like this?
[lua]local recycle
local transit
local paddle = display.newRect(0,0,100,20)
paddle.y = 100
paddle.x0 = 50
function transit()
transition.to(paddle, {time=1000, x = display.contentWidth + paddle.width*2, onComplete= recycle})
end
function recycle()
paddle.x = paddle.x0
paddle.y = math.random(50, 400)
transit()
end
transit()[/lua] [import]uid: 16142 topic_id: 19664 reply_id: 75988[/import]
@darkconsole yes what I was looking for also just one last question when I test your example I get this error in saying
2011-12-27 10:36:09.056 Corona Simulator[10027:903] Got error in FileWatch lastTimeModification
2011-12-27 10:36:09.056 Corona Simulator[10027:903] Got error in FileWatch lastTimeModification
2011-12-27 10:36:09.060 Corona Simulator[10027:903] Got error in FileWatch lastTimeModification
etc…
I just repeats I don’t understand it is that normal?
EDIT: Is not an error but is weird that it appears [import]uid: 17058 topic_id: 19664 reply_id: 75989[/import]
i have a latest stable build, so it must be something in newer one, i dont know [import]uid: 16142 topic_id: 19664 reply_id: 75992[/import]
@darkconsole also on the last part example you added the one with the paddle how would I add physics body so the platform would be solid [import]uid: 17058 topic_id: 19664 reply_id: 75994[/import]
just add physics body to it
physics.addBody(paddle, “static”) [import]uid: 16142 topic_id: 19664 reply_id: 75999[/import]
@darkconsole I keep on getting an error when putting the physics the error says
attempt to index global ‘physics’ (a nil value)
mmmmmmm what could that mean?
[import]uid: 17058 topic_id: 19664 reply_id: 76000[/import]
This line makes the physics engine features available under the “physics” namespace:
local physics = require “physics” [import]uid: 108660 topic_id: 19664 reply_id: 76001[/import]
@jeff472 yes your rite omg how could I forget that line of code. thanks see I usually forget to put things when I code.
[import]uid: 17058 topic_id: 19664 reply_id: 76003[/import]
@darkconsole I still did not understand what you meant when you said
“i have a latest stable build, so it must be something in newer one, i dont know”
Can you please clarify it [import]uid: 17058 topic_id: 19664 reply_id: 76017[/import]
my Corona sdk version is 704, yours i suggest is one of the daily build
i dont think there’s something wrong in my code, its working perfectly, so maybe its from your side [import]uid: 16142 topic_id: 19664 reply_id: 76028[/import]
@darkconsole mines is 706 so what you think I should do get the the newest or your version 704? [import]uid: 17058 topic_id: 19664 reply_id: 76033[/import]
try everything) [import]uid: 16142 topic_id: 19664 reply_id: 76050[/import]
@darkconsoles well thanks I download build 704 and it worked yeah. But that weird that it shows in some builds mmmm must be a bug [import]uid: 17058 topic_id: 19664 reply_id: 76055[/import]
probably, its daily builds after all [import]uid: 16142 topic_id: 19664 reply_id: 76058[/import]