razorMonkey's Recent Forum Activity

  • You can select object behind other object by holding TAB and clicking. Hope that it helps.

  • You could use condition "System-Compare two values" and the type in "sprite.Pathfinding.MovingAngle".

    You will need 8 double conditions for every combination:

    One which includes 0 angle will have to look like this:

    If sprite.Pathfinding.MovingAngle > 337 or sprite.Pathfinding.MovingAngle < 23 then "look east"

    Others will have to look like this:

    If sprite.Pathfinding.MovingAngle > 157 and sprite.Pathfinding.MovingAngle < 203 then "look west"

    If sprite.Pathfinding.MovingAngle > 203 and sprite.Pathfinding.MovingAngle < 247 then "look north/west"

    and so on..

    EDIT

    also use else between them for better performance

  • You have to pick the right car with condition beforehand. Can you post capx or picture with code where car entering is managed?

  • But does it work now? Or do you thank me just to be polite?

  • I see where could be the problem. If your speed is greater than max speed he will not add enough additional speed to your direction. So I tried with different approach, it seems to work now.

    So instead of subevent in line 2 I added new event in line 3.

    As for adding dt in acceleration and deceleration, my mistake, it seems Custom Movement behavior already incorporates DT in acceleration so ignore my advice here

    (but you will need it for any movement you will be coding on your own)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, I just took care of maximum speed. Now I will take care of the angle of motion.

    Can you drop the .capx here? ...

    No. That would be too easy

    As you can see on the picture, I added two new actions in line 5 and 6 that will take care of the angle of motion.

    Now if you wish that angle of motion follows smoothly angle of submarine rotation it should be the same as rotation of submarine (like in this example, 125). If you want some inertia you should lower it and it will feel like drifting with car. If you make it higher it will act strangely. Try to play with it to get the result you like.

    EDIT:

    also I would suggest that you add dt to acceleration and deceleration, otherwise it will act differently with different framerate

    EDIT 2:

    just ignore line 2, I put animation speed by mistake

  • Ash10500 - he already uses UID

    Unnatural20 - in that case it will check all collisions which will eat more resources.

    Best way would be to first pick 2 objects by UID and then check only these two object for collisions.

  • My pleasure

  • I believe your solution is more hardware demanding because it checks for all collisions and then looks if any collision that happens is the right collision.

    With familliy trick you can pick right instances and then look just at collision between these two.

  • Hi,

    I am from Zagreb, worked in Flash and Actionscript 3, now I work in Construct 2.

    Games are my hobby, but I dream to become professional one day who could live of game development

    My Kong profile with published games (Battlesun 2 is HTML5/Construct 2, else is Flash):

    http://www.kongregate.com/accounts/Razormonkey

  • 1. it should be targetAngle = angle(car.x, car.y, target.x, target.y)

    2. you should compare that angle to the angle of car, so if targetAngle < car.angle it turned right, else it turned left.

    But also there is problem with angle 0 where 0 becomes 360, so it should be:

    if targetAngle < car.angle = right

    or

    if targetAngle > car.angle + 180 = right

    else = left

    Hope it helps, if you give capx maybe I could help more.

  • Excyis, instead of "spawn" you should use "create" and then set angle of motion to "turret.angle + random(-30, 30)":

    https://www.scirra.com/forum/039-on-created-039-angle-changing-does-not-when-spawning_t83604

razorMonkey's avatar

razorMonkey

Member since 4 Dec, 2013

None one is following razorMonkey yet!

Connect with razorMonkey

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies