How do I isometric help/movement

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am making a game with a friend and we need some simple movement down and I am puzzleed on how it would work I have the idea of the movement written

    if mouse click is -y of player then change players orientation/sprite to down

    Down = -y

    if mouse click is +y of player then change players orientation/sprite to up

    Up = +y

    if mouse click is -x of player then change players orientation/sprite to left

    Left = -x

    if mouse click is +x of player then change players orientation/sprite to right

    Right = +x

    the capx has the sprites and diffrent angles and everything in it but I dont know how to change the sprite depending on where the mouse click is [attachment=0:1uoq5rh8][/attachment:1uoq5rh8]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ZS17 I think there are some tutorials on isometric movement on the forum here.

    Also, check out s plugin's / behaviors -- I think he has a solution here too

  • You need to check the angle between your object and the mouse click. Here is an example of 4 directional movement:

    On mouse left click (Trigger)

    Next you need the four directions, Since the angle is calculated from 0 to 180 degree when going clockwise and 0 to -180 degree when going counter clockwise you have to add 360 to those in the counter clockwise direction to get the correct angle.

    So you will need 4 sub events, one for each direction and these you check with a between values.

    Up (Since this is going counter clockwise we add 360)

    Condition:

    255 <= 360 + angle(Object.x, Object.Y, Mouse.X, Mouse.Y) <= 315

    Action:

    Object.Angle = 270 (So whenever you click above the object in a cone shape it will set the angle of the object to 270)

    Down (Since this is clockwise we don't need to add anything)

    Condition:

    45 <= angle(Object.x, Object.Y, Mouse.X, Mouse.Y) <= 134

    Action:

    Object.Angle = 90 (So whenever you click below the object it points down)

    Left (As it changes from positive to negative as it goes pass 180 you need two conditions and an OR)

    Condition:

    180 <= 360 + angle(Object.x, Object.Y, Mouse.X, Mouse.Y) <= 224

    OR

    135 <= angle(Object.x, Object.Y, Mouse.X, Mouse.Y) <= 180

    Action:

    Object.Angle = 180

    Right (Exactly the same as for left except now it changes as it goes pass 0)

    Condition:

    0 <= angle(Object.x, Object.Y, Mouse.X, Mouse.Y) <= 44

    OR

    315 <= 360 + angle(Object.x, Object.Y, Mouse.X, Mouse.Y) <= 360

    Action:

    Object.Angle = 0

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