John Kimbal's Forum Posts

  • 12 posts
  • Hi R0j0hound, thanks for the example.

    Very interesting and wondering why my own attempt didnt work. However I found a solution, tho not as elegant as yours.

    Made two sprites,one with origin at bottom middle, the other at top middle. Then aligned the upwind sprite (origin bottom middle) to wind.angle+90 degress so that the sprite represents the upwind part of the screen. And the same with downwind sprite. They are pinned to player on position only so that they dont turn with the player. Works, but probably uses a lot more resources, which bothers me so will implement this method instead.

    Thanks again tho,

    John

  • I set it up like this:

    https://dl.dropboxusercontent.com/u/114 ... xample.jpg

    But its not working.

  • Hi,

    I am doing a top down sailgame quiz. And for that I need to be able to determine (every tick) which of two points are "Upwind" or "downwind" to the Wind.angle.

    I compare the Player.Pos and Enemy.Pos but how to compare that to the Wind.Angle ? Is this the point when I need to look at Trigonometry? I already read about trig. but not entirely sure how to apply that in C2.

    Any hint, direction or vector would be appreciated.

    Best

    John

  • Holy crap, it works and my head just exploded!

    So for anybody looking for this in the future, this is what made it work. The sprite does its thing pointing right, but in the output to the screen (Text object) I make an action like this: (Text Object) Set text to "Sailboat angle:" & (Player_Sailboat.Angle+90)%360

    Didnt know that was what % does!? I consider this solved. How do I tag it solved btw?

    Thanks a bunch for the help, really appreciate it.

  • Only problem is when the ship is going right (0 degrees) and I turn left by one degree, the course will be 449. True north/Up is 360. But from Up to left it will go up to 449 before being 90 pointing left.

  • Just been playing around with that, and its probably the best compromise so far.

    Thanks!

  • Thanks for the input so far, really appreciate it!

    • Rotating the sprite wont work as I will put on a either a Bullet behavior or a customMovement (not decided yet) but it would make my ship go sideways.
    • Not sure about using a variable to set the wind direction but will experiment with it.
    • Tried rotating the layout at start of layout but didnt work, since the numbers are the same. I mean the wind direction was now correct but the ship is 180 degrees wrong. Wondering if i can make the bullet behavior work to go backwards etc. This migh actually work.

    But after some thought, I will drop it since, its not really part of the core game play. But if I implement it later i will just do it in the Texture rather than by the numbers. But it still bothers me that I cant do it. At least for now.

    But im still listening if anyone has a way, even if its complicated. Happy to learn.

  • Hi

    I am building a ship game and for that it would be really useful if could make rotations point up, and not right, when at 0 degrees. Any suggestion? It driving me mad and I have been searching high and low, but cannot find any information on how to do that.

    It goes for Wind direction and for Ships rotation. Need it all to give me true North. Read in tutorials for other engines that talks about "adding" -90 degrees to rotation output but completely lost in where and how to do that. I guess with a system expression or a function? And wouldnt that mess up the CustomMovement behavior I have added ?

    Any suggestions would be much appreciated.

    Regards

    John

  • Yes they had their own event sheets. And I did what you suggested and it works now. Thanks! Can see I need to re-arrange and spread out my game controls etc to different Event sheets.

    Cheers!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi everyone,

    I have searched the forum and read the manual to find out what I am getting wrong. But without getting any wiser.

    I have a main menu with a start button that uses Goto layout "Level-01" and that works fine.

    But in Level-01 I have a pause menu setup. It uses a function to set timescale to 0. In this menu I have a QuitToMainMenu button. But when I use goto layout "StartMenu" nothing happens. I have no idea what causes it to not respond. Is it the timescale set to 0?

    Have tried to put the code different places to see if it changed anything. Really lost.

    Here is a screenshot of my Event sheet.

    https://www.dropbox.com/home?preview=Construct+2+beta+release+r220+%28Administrator%29+-+Maze_prototype_01.capx+-+Event_Level.jpg

    Any hints really appreciated.

    Thanks

  • Solved it by putting on the Wind indicator/angle a within 180 degrees of Sailboat.Angle.

    And then a Sailboat is Clockwise from Wind.Angle.

    If people have other solutions I am more than happy to hear them.

    Thanks

  • Hi

    I am in the process of making a sailboat game. I have problem detecting when the wind is coming from the Left side or Right side of the ships center axis.

    No matter what direction you point the ship. The nose of the ship is always "Zero rotation" and from that, I want to measure/detect what angle the wind is coming from. And if its more than 180 degrees it will be coming from Left side and if less from Right side. Not sure how to write that in math. Im sure someone who is good at math can write an expression that does it but if any one can point me in the right direction i would be much appreciated.

    My best result so far is using anglediff but it only shows the shortest angle so cant use the numbers to tell if its from left or right side.

    Cheers

    John

  • 12 posts