A layer angle problem

Get help using Construct 2

Post » Wed Mar 20, 2013 9:48 pm

Hi Everyone,

So I have this game concept in mind and so far it's going well but i've hit a snag. I'm using layer rotation to simulate gravity shifts within the game. The player uses a Mouse XY input to travel from planet to planet then when arriving he can walk around their edge. This rotates the planets around him.

Now straight off the bat i'm not using the system from 'AirScape'. Though slick, it's not right for the final style or feel of this game.

So the problem arrises when rotating the layers to make sure the player is always right side up. It firstly knocks the sprite out of line and then when trying to travel to the next planet the Mouse X & Y are offset. Here is the .capx and the controls so far.

left click to move around
double click on a planet to land
space to take off
left and right buttons to move round a planet

https://dl.dropbox.com/u/15490467/HTL.capx

I would really appreciate a solution to this.

Blacksuit
B
3
Posts: 18
Reputation: 336

Post » Wed Mar 20, 2013 10:11 pm

I can't really give you a direct solution as I'm not really understanding everything you are doing yet, but here are some general things you should think about:

1. Why aren't you using platform behavior? Rotating the planets instead of the player may present some problems. I see what you are trying to do but I don't think it's the most efficient way.
2. You are not using dt in your expressions. check out this tutorial.

If you change to something more 'conventional' (player with platform behavior, gravity angle, and solid planet) many of these issues will resolve.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Mar 20, 2013 10:57 pm

Hi Squidster,

Thanks for getting back to me. I'll have a look at the dt expressions.

I found your gravzones tutorial first but had lots of trouble getting it to work. Then I saw the pin behaviour and have gotten much further with it and it really fits the style I have in mind. Plus this will be a very small game and am quite happy to continue with this method.

Anyway the real problem is rotating the layers to keep the character right side up. I'm just not clear on a way to do this that won't ruin the mouse XY input movement between planets. All I need is a workable solution that will fits in with the way I have been building it so far.

kindest regards,
B
3
Posts: 18
Reputation: 336

Post » Wed Mar 20, 2013 11:30 pm

Perhaps this is a better example:
https://dl.dropbox.com/u/15490467/HTL.capx

In the events the layer rotation is in the last group is labeled 'Gravity'.

In this version you will see that travelling to each planet by double clicking works fine and gravity rights itself. But after walking round a planet then travelling to another the mouse x y movement is messed up.

B
3
Posts: 18
Reputation: 336

Post » Thu Mar 21, 2013 11:40 am

Can't look at it right now, but perhaps a quick fix would be to use mouse.x("layer") and mouse.y("layer"). Try it for all your layers, see if it works.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Mar 21, 2013 2:07 pm

Hmm, nice idea but no dice. It just makes the player drift off in one direction.

I'm constantly working on this to try and get an answer but still no closer to a sloution

EDIT: I just switched the mouse x y move to behaviour for an 8 direction and even that messes up when rotating the layers.blacksuitfilms2013-03-21 14:24:24
B
3
Posts: 18
Reputation: 336


Return to How do I....?

Who is online

Users browsing this forum: Rezzon71, theosciandra and 23 guests