How do I fix this directional shooting issue?

Get help using Construct 2

Post » Thu Mar 26, 2015 1:37 pm

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.
  1. For better results, press the 'A' key to switch beam.
  2. Press the left arrow key so the player faces the left side of the screen.
  3. Press space bar once.
  4. 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?
B
3
Posts: 4
Reputation: 185

Post » Thu Mar 26, 2015 6:08 pm

set the speed to minus when facing left
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
55
S
13
G
2
Posts: 282
Reputation: 6,251

Post » Fri Mar 27, 2015 5:48 pm

puntodamar wrote: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.
B
3
Posts: 4
Reputation: 185

Post » Fri Mar 27, 2015 5:52 pm

Cant help without seeing your capx.
B
46
S
16
G
9
Posts: 1,096
Reputation: 11,153

Post » Fri Mar 27, 2015 6:23 pm

yeah, that's true
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
55
S
13
G
2
Posts: 282
Reputation: 6,251

Post » Fri Mar 27, 2015 6:42 pm

Apparently attachments are disabled for the moment, so I can't add it at the moment.
B
3
Posts: 4
Reputation: 185

Post » Fri Mar 27, 2015 8:25 pm

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.
Freefall Bird
B
40
S
8
G
5
Posts: 276
Reputation: 5,488

Post » Tue Apr 07, 2015 11:59 am

Ragevortex wrote: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.
B
3
Posts: 4
Reputation: 185

Post » Wed Apr 08, 2015 8:56 pm

Glad to be of service. Hope your game is ending up awesome.
Freefall Bird
B
40
S
8
G
5
Posts: 276
Reputation: 5,488


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 7 guests