What is the best method for creating scrolling in a game?

My game consists of a draggable player that starts at the bottom of the screen and must navigate past enemies to reach the top of the screen. The enemies spawn off-screen left, at random heights, and zip across the screen to off-screen right. However, at one screen’s height, my playing field is too short, and my player can traverse to the top of the screen too quickly, facilitating the need for an elongated background several screens high. After the player appears on screen, I want this background (and the moving enemies as well) to start slowly scrolling downwards.

My question is: is the use of ‘transition.to’ the way to go? Or is there a better method to use? Any advice would be much appreciated.

Thank you,
Steven

[import]uid: 79394 topic_id: 16490 reply_id: 316490[/import]

you can have transition.to but then you only have as much control as you have, where you can cancel the transition or let it run.

You can use the enterFrame instead that can let you move individual objects at individual speeds, but you have the onus to move each one of them.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16490 reply_id: 61552[/import]

Thank JayantV.

Luckily for me, I don’t need to move individual objects at different speeds, so transition.to it is!

Cheers,
Steven [import]uid: 79394 topic_id: 16490 reply_id: 61805[/import]