How do I shoot left?

0 favourites
  • 7 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • I am making a platform game where the player has a gun but I don't know how to make him shoot to the left. How do I do this?

  • bullet- set angle of motion- 180

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd give the player a variable called Facing Direction and use Joannesalfas suggestion too.

    If Left is pressed, set Facing Direction to Left

    If Right is pressed, set Facing Direction to Right

    If SPACE is pressed

         FacingDirection = Left, set bullet angle of motion to 180

         FacingDirection = Right, set bullet angle of motion to 0

    If you want I can make a .capx for you too

  • hi,

    im new on construct 2 and i have the same problem.i tried your suggestion but can't figured out.here is a link of my capx can you please help?

    dl.dropbox.com/u/8046259/eskiz.capx

    thanks

  • <img src="http://img94.imageshack.us/img94/3572/topic60103shootleft.png" border="0" />

    Muratcizer,

    First thing I see here is that you have an event with completely contradicting actions. This makes your B button not work at all at the moment.

    You can't throw all your bullet angles into the same event. You need to break it up into at least two separate events.

    There is a bit of work that needs to go into this. I would suggest going over the manual at least once.

    Your bullets should spawn on a layer other than your background. Move them to layer 1.

    You are being redundant calling out the imagepoint for adam. When you have Adam spawning the bullet and it prompts you for which image point it spawns on, you are directly telling it which image point on adam it is being placed. Just put 1.

    Also, for some reason you image point appear misaligned for whatever reason. As you move up on the plateforms the point relative to your sprite adam also goes up. As you move right the spawn point moves further right. There appears to be some major bugs going on that I can't seem to figure out.

    Also, you have a memory leak by creating an endless supply of bad guys every 2 seconds that move left and are not destroyed under any condition when they move off screen. You'll want to address that. the same goes with the bullets.

    TL;DR by seperating your current statement to spawn a bullet into two different events, it would shoot perfectly left or right depending on which way he was facing.

    Good luck getting the rest of the bugs sorted.

  • Figured out why your spawn point for your bullets was moving all funny. You resized your main sprite after creating it. The game information for that sprite does not match what you have currently sized on your layout. When firing its attempting to spawn at imagepoint 1 where your full sized sprite would be.

    Resize the sprite in the editor, or through another program like paint or photoshop, and this should be fixed.

    There are so many reasons other than this strange bug to not manually resize an image on the layout (pixelilation of graphic alone should make you shy away from this method).

  • many thanks.You points are usefull.i learned so much.i will try your suggestions.

    sorry for my poor english.

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