Scrolling and Physics

Hi all,

Searched the forums but am still unclear on the best way to do this.

Essentially I wish to ‘scroll’ my physics objects i.e. the level is larger than the screen.

Currently I move them myself - which works fine.

But if they were true dynamic physics objects I can’t do that.

So how do I move my physics objects to be in line with my map but not actually move them :slight_smile:

I thought perhaps somehow all display objects have a parent (the scroll layer) and I move that for the scroll - is this the correct method?

I am using sprite helper and level helper.

thanks in advance

Try my library, Perspective :)

  • C

:slight_smile:

Funnily enough ; just looking at that.

So will it deal with physics objects? i.e. will they be at the correct point in the viewable world if I pan around??

Also, how do I implement this with say Sprite and Levelhelper?? i.e. how would I add an object to your camera from either of those?

thanks though!! 

It deals perfectly with physics objects,  as long as each layer with physics objects in them have the same parallax ratio. If you want objects to collide correctly, their layers must have the same parallax ratio.

As for SpriteHelper or LevelHelper, I don’t have them, so I can’t really help you :slight_smile:

Not really sure how they work, but it would appear that you could go into the code itself of your project and do it from there…?

  • C

Thanks!

Out of interest was my original ‘method’ correct? i.e. is this how you did it? ; add all objects to 1 parent object and simple move that around to simulate camera pan?

Cheers

Yep, that’s how my camera library works. Although instead of adding all objects to one parent, Perspective uses layers, each of which move on their own.

C

Thanks!

I’ll give it a whirl first on my own - then if/when I fail will come back to your lib!!

Cheers

Try my library, Perspective :)

  • C

:slight_smile:

Funnily enough ; just looking at that.

So will it deal with physics objects? i.e. will they be at the correct point in the viewable world if I pan around??

Also, how do I implement this with say Sprite and Levelhelper?? i.e. how would I add an object to your camera from either of those?

thanks though!! 

It deals perfectly with physics objects,  as long as each layer with physics objects in them have the same parallax ratio. If you want objects to collide correctly, their layers must have the same parallax ratio.

As for SpriteHelper or LevelHelper, I don’t have them, so I can’t really help you :slight_smile:

Not really sure how they work, but it would appear that you could go into the code itself of your project and do it from there…?

  • C

Thanks!

Out of interest was my original ‘method’ correct? i.e. is this how you did it? ; add all objects to 1 parent object and simple move that around to simulate camera pan?

Cheers

Yep, that’s how my camera library works. Although instead of adding all objects to one parent, Perspective uses layers, each of which move on their own.

C

Thanks!

I’ll give it a whirl first on my own - then if/when I fail will come back to your lib!!

Cheers