A layer angle problem

0 favourites
  • 6 posts
  • 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


    I would really appreciate a solution to this.

    Blacksuit <img src="smileys/smiley1.gif" border="0" align="middle" />

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

  • 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,

  • Perhaps this is a better example:


    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.

    <img src="smileys/smiley19.gif" border="0" align="middle" />

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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