How do I get this Sprite to shoot left?

Get help using Construct 2

Post » Wed Dec 10, 2014 8:44 am

So I've got this really simple player Sprite (you might even call him a square) and he's got platform behavior. He walks left, he walks right, jumps up and down. The whole thing.

He also spawns another Sprite with Bullet behavior with a button press.

But he can only fire right. Because the bullet speed is positive. If I trigger the sprite to mirror on a direction press the bullet will spawn from the opposite side, but it still travels to the right. I can get the bullet to travel left if I change the player sprite's angle 180 degrees. BUT, this causes the sprite to be upside-down, and not mirrored like I want.

Changing the speed of the bullet to a negative number with a corresponding direction press would logically work, but by doing so it seems to change the direction of already fired bullets as they travel across the screen.

This should not be this hard? What am I missing here?
B
5
Posts: 17
Reputation: 259

Post » Wed Dec 10, 2014 9:05 am

Lol I have the same problem with my platform game..... now need to wait till I found the solution.
Help please
B
7
S
1
Posts: 14
Reputation: 531

Post » Wed Dec 10, 2014 9:32 am

borneoboy wrote:Lol I have the same problem with my platform game..... now need to wait till I found the solution.
Help please


Since I posted my question I tried a work around that kind of works. I created a second bullet sprite with a negative speed (so it goes left) and set up a numeric variable in an array called LeftRightShot that gets set to either 0 or 1 whenever you press right or left. using that number I trigger which bullet fires and from what image point on the player sprite.


This works. But it doesn't seem very elegant. And if I mirror my sprite (to show it running left of right some how) it'll mirror the image points.

EDIT: and I just realized, if I'm going to mirror my sprite I don't have to have a second image point to spawn the second bullet sprite, since I'm mirroring my first one I just spawn my left firing bullets from the same image point.

So yeah... this seems to be the solution? Have two bullet sprites, one for each direction? And a bunch of triggers to keep them in check?
B
5
Posts: 17
Reputation: 259

Post » Wed Dec 10, 2014 9:37 am

I'm uploading video to youtube now.. please take a look.. all left action failed
B
7
S
1
Posts: 14
Reputation: 531

Post » Wed Dec 10, 2014 9:39 am

Message: borneoboy is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
here are my video
B
7
S
1
Posts: 14
Reputation: 531

Post » Wed Dec 10, 2014 9:40 am

zzzzz I need 300 rep required before I can share youtube link sooooooooooo disapointing
B
7
S
1
Posts: 14
Reputation: 531

Post » Wed Dec 10, 2014 9:46 am

I already try using left sprite instead of mirror.. but I failed to do that... but I'm gonna try that again since you manage to solved yours
B
7
S
1
Posts: 14
Reputation: 531

Post » Wed Dec 10, 2014 9:48 am

12345678910https://www.youtube.com/watch?v=87NNNV6HA4Y&feature=youtu.be

delete the 1234567890 and you have the link
B
7
S
1
Posts: 14
Reputation: 531

Post » Wed Dec 10, 2014 9:50 am

When you pick up the Pig, are you creating a separate pig bullet sprite?
B
5
Posts: 17
Reputation: 259

Post » Wed Dec 10, 2014 10:14 am

yes... its all separate sprite.... I just dont know how to apply on left arrow press and apply the left throw of what so ever for the left
B
7
S
1
Posts: 14
Reputation: 531

Next

Return to How do I....?

Who is online

Users browsing this forum: Mayfly and 17 guests