Rotation questions..

Get help using Construct 2

Post » Sat Feb 18, 2012 9:50 am

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..

UberDark2012-02-18 09:54:54
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Feb 18, 2012 3:00 pm

Very easy to answer - for objects to detect the colission, the BOTH must inherit the physics behaviour...
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sat Feb 18, 2012 3:14 pm

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.
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Feb 18, 2012 3:16 pm

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.
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Feb 18, 2012 3:19 pm

An explanation with a capx.

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

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).Kyatric2012-02-18 15:24:40
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Feb 18, 2012 3:23 pm

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 explanationWeishaupt2012-02-18 15:26:07
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sat Feb 18, 2012 4:11 pm

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
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Feb 18, 2012 4:17 pm

"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...
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sat Feb 18, 2012 4:29 pm

As i said, i think i understand it now, but i think for someone that does not yet understand it may be confusing. ;)
B
54
S
7
G
8
Posts: 150
Reputation: 5,812


Return to How do I....?

Who is online

Users browsing this forum: BACLog and 20 guests