Platform shooter

0 favourites
  • 4 posts
From the Asset Store
The complete source file for my Youtube platformer game tutorial series.
  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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;

    <img src="http://s13.postimg.org/tz8hqqid3/bulletdirection.png" border="0" />

    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?

  • 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! :)

  • 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.

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