0 Favourites

How do I make lasers shoot out while moving this Rocket?

  • Well basically, I've come to the conclusion for my game that the player needs weapons! In order to use these weapons in the most efficient manner, they need one stick to move the player and the other to aim/fire the laser. So, it's a lot like Geometry Wars....

    At first I just had the lasers spawning in front of the Rocket and the player would move, causing the lasers to shoot towards enemies and killing them. Terrible Idea. So then I thought that all I had to do was apply the same controls to the laser, same as the Rocket has, and that didn't go too well. So that's where I'm stuck.

    When I drag the stick on the left(red one) the lasers act funny and I mean FUNNY. How do I make it so the lasers shoot out at the angle the control stick is facing? and fix the rate at which they shoot at?

    The left control stick is for laser and the right control stick is for movement of the rocket. This is clearly a mobile UI design for those wondering.

  • The implementation of your thumbsticks leaves a lot to be desired..

    I would opt for using TouchID and dropping the drag and drop behaviour..

    Here's an example with one thumbstick, but adding a second should be easy..

  • Woah, it actually makes the rocket change speed depending on how far the control stick goes. Amazing.

    But one problem. I've applied it to my own project and for some reason it's not working....

    What's wrong?

    Also, may I add, I received quite a bit of assistant with the drag and drop stick. Still a beginner here....

    Your right though, this stick is definitely greater in terms of maneuvering the rocket.

  • You should change the "Controls" in the thumbstick-events with "HUD", because that's the name of the layer on which the controls are..

  • Oh..... Thanks for that.

    Now for the shooting stick.

    I managed to create the shooting stick and have the lasers shoot 360 degrees. I've learned how to set speed and make it so they are at a constant speed and they don't adhere to the shooting control stick position. Only problem is, how do I make the fire rate more controlled? there's a lot of them shooting once the control stick is being dragged.

  • What would you like the fire rate to be?

    right now every tick while the stick is selected a bullet will be fired.

    at 60fps this is 60 bullets per second.

    You could use an every x seconds event for the bullet creation action?

  • Ah...

    Now this is what I'm talkin about!

    Thanks Stain. Do you recommend any other improvements?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I made the spray only spray while moving and have the spray rate follow the speed..

    destroyed the onscreen laser on start of layout..

    removed some events and put their actions in more logical places..

    Not sure if it's better or to your liking, you could always change some settings..

  • Thank you for that thread !

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