Rotation questions..

  • I decided to try and use the rotate layer option for adding a bit of dynamic to a platformgame. But now i run into situations i didn't expect..

    Is it supposed to be the case that when i rotate a layer full of solids (platforms) and i have a player character on another layer that is not rotating the collisions mess up (seem to not move with the solids) but the gravity does seem changing with the layer?

    Perhaps i am doing something wrong so here is an example of what i mean.

    http://dl.dropbox.com/u/1750576/rotating%20layer%20in%20platformer%20test.capx

    Also i ran a test spawning objects with physics in the same layout with the rotating layer of solids but they refuse to collide.

    http://dl.dropbox.com/u/1750576/physics%20and%20rotation%20test.capx

    Thanks in advance!

    I dunno..

  • Very easy to answer - for objects to detect the colission, the BOTH must inherit the physics behaviour...

  • When i am assigning behaviours to the objects and i select the SOLID behaviour, the info text at the bottom of the window states that when this is set other objects cannot move or fall through it. The way you explain it that info text is misleading since as far as i understand objects can only fall when physics is on.

  • And what about the platform example showing that one rotating layer means gravity rotates for all layers and collision detection does not seem to also rotate.

  • An explanation with a capx.

    I also had made this image to illustrate the principle in another topic:

    <img src="http://dl.dropbox.com/u/36472942/construct/forumhelp/LayerRotation.jpg" border="0">

    The black big rectangle is the layer unrotated, the black crosses are image points of the unrotated object, red big rectangle is the layer rotated and the red crosses are the "for C2" positions of the imagepoints, whereas their coordinates (x, y) are unchanged.

    So for gravity, it is the same, it is a force applied to a certain angle (towards the bottom of the screen).

    If you want to handle gravity with a layer rotation, set the "regular" gravity to 0, and everytick apply a force to the object at RotatedLayerAngle + 90. (example capx)

    Edit: Physics and other behaviors are not meant to work with each other.

    Either stick to platformer/solid (same rotation principle applies normaly and I believe you can set gravity on the platformer behavior to the angle of your choice) or use only physcis behavior (platforms being immovable physics objects).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • intresting issud. The colision detection works as long as the player sprite has not hit the ground.

    The general question is, what are you trying to achive? Rotation colission detection works - take a look at my arcade entry - Eye of the Tornado

    @Kyatric - thanks for the great explanation

  • Yes indeed thanks!

    I wasn't really trying to achieve anything in particular.

    I read bits here and there about it and figured i would give it a go. Play a bit and see what my findings are. Maybe i would get inspired or i would stumble upon something i could use later.

    Thanks guys..

    P.S. I still think the info text of the 'solid' behavious is confusing though. Something cannot fall without physics right? So it will always go through a solid// Still lost on that last bit whehe

  • "SOLID" is a behaviour that works with the Plattform-Behaviour. If you use the physics-behaviour, that you should NOT use in combination with Plattform, you have to set the object to immovable...

  • As i said, i think i understand it now, but i think for someone that does not yet understand it may be confusing. ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)