frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Shooting

edited November 2013 in Game Design
http://flowlab.io/game/view/20765
In my game I can't figure out how to make the bullets only when the player obtains shotgun or how to make them move the direction pointing or at all.

Comments

  • Sure I can help you with that.
    Open behaviors on your player object.
    Drag down a press button trigger, set it for say "spacebar"
    Now create a new object.
    Checkmark "moveable" and then open behaviors.
    Add "Always" trigger, connect that to a number.
    Add any number you want but I recommend above 20 or the bullet falls.
    I forget how to lock Y so it doesn't, ask grazer later.
    Now connect that number to a "velocity" for forward.

    Go back to your player
    Connect an "Emitter" to your button trigger "spacebar"
    Set the emit to your bullet object
    Set the emit to match direction, set your force to 5 so it doesn't appear behind you
    Now set the age before it disappears.

    I would suggest you add a "collision" "any" to "destroyer" for your bullet object so its not sliding up and down the wall until it disappears.

    Hope I helped :)
  • Thanks! Helps a lot. But I have one question now. how do you make it shoot only when he picks up the weapon and how do you make it change direction when you change?
  • As for having a gun or not you will want a toggle switch.
    I noticed you have a lot to fix.
    I said The weapon click and Set the emit to MATCH DIRECTION, if you face left it should shoot left. For the bullet you have it on (x), connect that number to a "velocity" for FORWARD.
    That will fix your current problem.
    The other suggestion I have is have the emit time go to maybe 24

    For your gun you have it an animation, what you should do instead is make a shotgun object and add an attacher to your player for the shotgun. You carry it instead of an animation. When there's the attacher on, it should have a toggle switch like this

    Spacebar goes to (in)
    Attacher both (out) goes to (swap)

    toggle (out 1) goes to nothing
    (out 2) goes to the emit

    Make sure you read closely what I type if you want it to work :)
  • loads of help, thanks!
  • Thanks dude
  • Ur a lifesaver
  • @Mhx Air can you screenshot the attatcher thing, i am conused. I wanna make it so my character can kill enemies only when his sword animation is going, wanna help?
    Failure at Flowlab is a Failure.
  • My bullets shoot behind me.
  • You talking about "BattleBlasterz"? They seem to be going the correct direction to me, but it's kind of hard to tell.
  • @Mhx Air Thx,now my bullets actually work!
  • how to shoot in upward direction for games like space invaders
  • Same as the tutorial I wrote, but change the forward direction of your object to up. You'll see it in the tab under where you edit the bounce and drag. Once your forward is up, objects should emit up.
  • I tried but it didn't work
  • no the forward of the object thats launching it
  • please help in my discussion
    above is the link
  • edited October 2016
    The discussion's right below... :P
  • how do i make my bullet move to the left not the right? halpppp
  • thanks alot it really works
  • Sorry could you please help i could not figure it out
    PLZ needs more detail in explanation
  • @luhar256

    This topic is from 2016, instead of posting here you should start a topic instead, or look up some other threads (don't post there either)
  • > first says it works
    > then says it doesn't work anymore
Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch