Rotating whole scene

Darkhog

  • Posts: 1243
I realize that I will probably need to built scene with actors to do that, but the problem is how to rotate ALL actors in scene along specific point (in this case, center of scene). Basically what I'm trying to do is to recreate game called Neverball in 2D using b2d physics.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

coleislazy

  • *
  • Posts: 2607
You can try playing with this:

Code: [Select]
FlxG._game.rotation = ?;
Also:

Code: [Select]
FlxG._game.rotationX = ?;
FlxG._game.rotationY = ?;
FlxG._game.rotationZ = ?;

coleislazy

  • *
  • Posts: 2607
Oh, nevermind. I thought you wanted the actors AND the scene. Sorry!

Alexin

  • *
  • Posts: 3132
Hide the sprites for all the actors and perform the drawing yourself, with the rotation applied of course.
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
Yeah, but you forgot that I need physics as well.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Alexin

  • *
  • Posts: 3132
So what? The physics engine still runs and interactions between actors are still correct, in relation to each other. Just adjust the gravity.
"Find the fun"
alexin@stencyl.com

DeathWish

  • Posts: 31
Maybe ask Austlang? He made a great game, Gravitas, with rotating the whole scene.

Darkhog

  • Posts: 1243
Alexin, maybe play Neverball for a little bit - there gravity always point down, only objects rotate. I want to remake this game in 2D.

//edit: @DW I don't thing Austlang will know answer since in his game actors rotate around their centers and I want to rotate actors around scene's center which often will differ as I will have scenes bigger than screen.

« Last Edit: November 06, 2011, 08:31:08 am by Darkhog »

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

austlang

  • Posts: 38
Alexin, maybe play Neverball for a little bit - there gravity always point down, only objects rotate. I want to remake this game in 2D.

//edit: @DW I don't thing Austlang will know answer since in his game actors rotate around their centers and I want to rotate actors around scene's center which often will differ as I will have scenes bigger than screen.

That's correct. I am also making a new game where I want actors to rotate around a point, and there used to be behaviors that did this. However, none of them work now and I am wondering if it is because of the new update?

Darkhog

  • Posts: 1243
I dunno. But can you help me with my question?

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

allornothing

  • Posts: 4
You can try playing with this:

Code: [Select]
FlxG._game.rotation = ?;
Also:

Code: [Select]
FlxG._game.rotationX = ?;
FlxG._game.rotationY = ?;
FlxG._game.rotationZ = ?;

Sorry to thread hijack, but I was looking for this effect - how/where would I implement this kind of 'rotate all' behaviour?

coleislazy

  • *
  • Posts: 2607
You could put any of those lines into a code block anywhere you would want the effect to happen. You could do it on a keypress, for example.

But be aware that in will move the "screen" itself, not individual elements. It will leave black background behind. That being said, it could be useful for scene transitions or for some interesting effects.