Excal's Forum Posts

  • if (360 + Target.Angle - Player.Angle) % 360 > 180   .... CCW
    else                                                 .... CW

    Should work for any valid angles.

    Thank you!

    Yann, you didn't offend me, I'm just extraordinarily harsh when I get replies that seem to 'probe' and be less related to answering the question.

    I think this might actually be a good add to the list of topics on the FAQ, but maybe better worded there because "Shortest rotation angle" can be kind of misleading.

  • TouchIDTest

    Try this on a mobile device and let me know if you are getting any Touch IDs.

  • Should I export this to a live server and show the touch IDs not being assigned there?

  • If Target.Angle = 350 and Player.Angle = 10, your formula suggests going clockwise, or 340 degrees. The correct answer is to go counterclockwise 20 degrees.

  • I don't see the black background you're talking about.

    Firefox 19.0.2

  • Did you even read the first post? I know how to rotate an object.

    However, there's a difference between rotating 10 degrees counterclockwise and 350 degrees clockwise. That's what I'm trying to solve.

  • If Player.Angle = 10 and Target.Angle = 0, then the absolute value is 10, and by your formula the shortest direction would be clockwise.

    However, that is incorrect because clockwise means turning 350 degrees.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I have an object facing in a direction that needs to turn to match the angle of another object, is there a formula to determine the shortest type of rotation (clockwise vs. counterclockwise)?

    This is NOT the same thing as determining the shortest way to turn to FACE another object, which is the formula I ended up creating. I need my object to MATCH the angle of another object.

    If you're curious about the facing formula, here it is:

    f

    (Player.X - cos(Target.Angle)) * sin(Player.Angle) > (Player.Y - sin(Target.Angle)) * cos(Player.Angle)

    ...then Clockwise is the shortest.

    Otherwise, counterclockwise.

    For those who don't understand what the above formula does, it basically draws a line behind the player and then determines which side of that line the target is on. However, the above formula made sense to me because I am able to think of it in cartesian coordinates and not polar ones.

    I'm trying to think of a way to determine the shortest way to match the angle of another object, and I can't seem to find a cartesian way to think of it.

    EDIT: Current line of thinking is:

    bs() = absolute value

    If

    abs(Player.Angle - Target.Angle) > abs(Player.Angle + 180 - Target.Angle)

    ... then Counterclockwise

    However, this fails if Target.Angle = 0, so this can't be it, even though it seems to work for a lot of cases.

  • Do you have a link to your web page, a screenshot, or anything more than that basic description?

  • I really enjoy how simple 8DirMovement has allowed us to easily assign controls with a single behavior, but the rotation speed is a bit ridiculous, especially if playing on a mobile on-screen joystick.

    Try my game on a mobile (currently having multitouch issues though) and you'll see how fast the ship turns.

    Is there any way we can set the rotation speed for 8DirMovement?

  • Link to .capx file (required!):

    https://dl.dropboxusercontent.com/s/s1m4htcwkjszy0f/TouchIDNotBeingAssigned.capx?token_hash=AAEqkLBauOIqJYWPkKblUztyijUMkSs9y8m1U7ULgs1BfQ&dl=1

    Steps to reproduce:

    1. Click on left side of screen.

    2. Click on right side of screen.

    Observed result:

    No Touch IDs are ever assigned.

    Expected result:

    Touch IDs should be assigned.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7 SP1

    Construct 2 version:

    125 (latest)

  • I have my debug box active in the live version at the moment. It updates every tick to show the LeftTouchID and RightTouchID.

    As you can see if you try the game, the touch IDs are never assigned. Touch.TouchID does not seem to be working. Could this be a bug?

    <img src="http://i.imgur.com/Vl1s0Hj.png" border="0" />

  • Hate to bump an old thread, but this is the same issue I'm having: how to get touchIDs for simultaneous events.

    kenhes, were you able to get a working solution? If so, can you share it? I find it unlikely that my other thread is going to get an answer since the majority of questions asked and answered here are more toward the beginner side.

  • Can someone outline for me the steps needed to get the different IDs for two different touches that occur simultaneously?

    I have two large invisible sprites, each set to width = layout.width/2. If the player touches on the left side of the screen, this creates an on-screen control. If the player touches the right side of the screen, this creates a different on-screen control.

    You can check out what I currently have here: Icarus. Note that you have to be playing on a tablet or mobile device to test both touch controls.

    What I have sort-of works right now, but when I add the second touch, the on-screen control shows up where the first touch is, causing both controls to overlap.

  • Can we update the tutorial on web apps to not hide the address bar to avoid the fullscreen problem?