How do I fix my slingshot?

0 favourites
  • 4 posts
  • my slingshot code only makes the slingshot shot right when i move right but when i move to the left it still shots to the right i want to make it where the slingshot can shot to the left when i'm moving to the left side

    video of issue:

    imgur.com/eW3smGr

    screenshot of code:

  • You can do this multiple ways, you can check what angle the player sprite has and go from there, or you can do the easy way and add 2 sprites one named "leftbox" 1 named "rightbox", make them invisible on startup, then if your player is walking left for example, you want to mirror the player sprite(im guessing you have done this).

    So you do "on Z is clicked" , but also check if "Player is mirrored", you can invert this option and it will be like "player is not mirrored".

    So if player IS MIRRORED, shoot towards object LEFTBOX, if player is not mirrored, shoot towards object RIGHTBOX.

    Im at work so i just quickly answered, if you need help you can add me on discord. #ironside6435 add me and i will answer when i can :)

    P.S: OOS below has a solution for your angle

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you're using the bullet behavior, there is an action to set the angle of motion. By default it is 0, which is right. So create a sub event (under your spawn projectile event) to check if your player object is moving left, and set the angle of motion of the projectile to 180.

  • If you're using the bullet behavior, there is an action to set the angle of motion. By default it is 0, which is right. So create a sub event (under your spawn projectile event) to check if your player object is moving left, and set the angle of motion of the projectile to 180.

    thanks!

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