Sometime the momo doesn't rotate properly.

0 favourites
  • 9 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • When I left click, the momo is suppose to fire from the cannon with a given speed and cannon's angle but sometime it doesn't. I've uploaded the code that i've used.

  • so you are setting the angle to aim at to the angle between mouse.x,mouse.y and mouse.x, mouse.y , this deems strange, because what is the angle between the same coordinates?

    why not just set angle towards mouse.x,mouse.y?

  • I forgot mouse_x and mouse_y are the coordinates of the mouse when the users presses the left click after that he drags the mouse and i'm getting the angle between that and current position of the mouse.

  • Strike that..

    guess I understand what you are trying to achieve..

  • If you are expecting the sprite to point at the mouse, this code won't do that..

    you are setting the angle of the cannon to the angle between mouse start and mouse end (to put it simply)

    this means the cannon doesn't take into account where the mouse is..

    if you left click and move right the angle will be 0

    if you left click and move left the angle will be 180

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No..no.. I don't want the sprite to point to the mouse. I want the sprite to rotate to the angle between previous mouse_X/Y and current mouse. I thought this was problem with bullet behavior or something. It works most of the time but some time it doesn't take the angle into account.

  • Why not set the bullets angle of motion to AngleToAimAt instead of sprcannon degrees?

    And any reason why you are setting position of sprMomo instead of spawning it?

    Problem might be you are not referencing sprMomo in your events..

  • I face the same problem with angleToAimAt. That's why I tried sprCannon's angle. The funny thing is even if the sprCannon is facing the right direction the momo will not act as if sprCannon's angle is 0. So, I thought It was problem with bullet behaviour.

    For no reason other than I felt like it, would it be different if I spawned it?

  • I guess the issue is the sprMomo isn't referenced in the event, also if you are using set position the bullet behaviour will already be enabled,..

    I'm not sure what MomoIsInsideCannon does.. Or what Momofired Does..

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