Platform shooter

Get help using Construct 2

Post » Sat May 18, 2013 3:07 pm

Im trying to make a platform shooter, and so far, everything is going smoothly.
Now I noticed that my character only shoots to the right, even when facing left. I've been searching for a forum post where this problem might already have been discussed, but I fail at finding one specifik enough.
I did fix it, except that the bullets that have been fired already, change angle and fly to the left when my character faces left. And if he faces right after that, they fly right again.
Can someone direct me to another forum post or tutorial that can help me?
B
4
Posts: 2
Reputation: 743

Post » Sat May 18, 2013 3:34 pm

It sounds like you're changing the direction of every instance of bullet, rather than the instance that's just been fired. If your character is only going to fire left or right, a simple way of doing it would be having two bullets; one that fires when the player is facing left, and one that fires if the player is facing right, and have that be the instance that is spawned when your character fires.

It sounds however, like what you want to be able to do is only affect the instance you've just created.

Forgive the crude example, but something like;



That is, if you're using mirrored to reverse your character. You still have to create your bullet instances. I left that part out.

Hope that's of some use.

Are you using the bullet behavior for your bullet object? I was under the impression that it fires off in the direction your facing. Unless you've created your own custom behavior?Nullus2013-05-18 15:39:29
B
3
Posts: 23
Reputation: 221

Post » Sun May 19, 2013 2:37 pm

I am using the bullet behavior, and the thing is that Im not using the mouse at all, the character has a machine gun, so it is "Hold spacebar -> spawn Bullet". When the character faces right, the bullet should go right, the gun is fixed so it only faces left and right. But using 2 objects for the bullet, one for right, one for left, that might actually fix my problem! Im gonna try that, and some other things, and I will post another reply if it dosen't give me the result I was looking for.
Thanks for the help and the quick reply!

*EDIT*

Your example worked! I can't belive I didn't figure that out myself. Thank you so much for the help! :)CarrotFace2013-05-19 14:45:14
B
4
Posts: 2
Reputation: 743

Post » Tue May 21, 2013 7:01 pm

Make an instance variable for the Direction of the character and set it's Value to "Right" and call this variable when you want it to face either "Right" or "Left" that should force the character to face in those directions.
I was having a major problem with that too I also took out the mirror and not mirror and duplicated the various animation and just flipped it to face left or right or what ever animation was missing. Hope this helps.
B
7
S
1
Posts: 33
Reputation: 623


Return to How do I....?

Who is online

Users browsing this forum: Matthew de and 26 guests