How do I fix this directional shooting issue?

0 favourites
  • 9 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • I have a family of 'beam weapons' with a Bullet behaviour. When I use events to change the properties of this Bullet behaviour, it doesn't seem to set it correctly.

    In this Platformer project the hero has four weapons to attack with. Using the WASD keys you can change between all of them. Everything looks right when the hero faces right, but when it faces left, something strange happens.

    When I can, I'll add an attachment, but for now here's a guide of how to reproduce the bug.

    • For better results, press the 'A' key to switch beam.
    • Press the left arrow key so the player faces the left side of the screen.
    • Press space bar once.
    • When the "count" meter on the top-left side of the screen reads 0, press space bar once. After half of a second, press space bar once again.

    The very first beam (the one spawned on Step 3, let's call it Beam 1) will move to the right. The first beam spawned on Step 4 -Beam 2- will move to the right as well. However, when the next beam is spawned (Beam 3), Beam 2 will start moving to the left, but Beam 3 will move to the right.

    All of the three beams must always move to the left when the player faces the left side of the screen, and any beam shot when the player faces the right side of the screen must always move to the right.

    How should I fix this?

  • set the speed to minus when facing left

  • set the speed to minus when facing left

    It doesn't seem to work. Now it'll invert the direction of every beam it's on the layout, besides the last one thrown which will keep moving to the right.

  • Cant help without seeing your capx.

  • yeah, that's true

  • Apparently attachments are disabled for the moment, so I can't add it at the moment.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I had a similar issue on one of my games. i did an event oncreated and combined it player is mirrored (or not mirrored) to switch between the direction of my bulits. and it will only affect the bulit that is created on that moment. I hope that helps you a bit.

  • I had a similar issue on one of my games. i did an event oncreated and combined it player is mirrored (or not mirrored) to switch between the direction of my bulits. and it will only affect the bulit that is created on that moment. I hope that helps you a bit.

    Thank you! It works fine now.

  • Glad to be of service. Hope your game is ending up awesome.

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