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

Just started using Construct 2? Post your questions here

Post » Sun May 24, 2015 8:39 am

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.

https://www.dropbox.com/s/eo5moa2rcc7d7 ... .capx?dl=0
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Sun May 24, 2015 3:07 pm

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..
https://dl.dropboxusercontent.com/u/485 ... ullet.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon May 25, 2015 3:31 am

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?

https://www.dropbox.com/s/y04zlnylttg2u ... .capx?dl=0

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.
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Mon May 25, 2015 8:17 am

You should change the "Controls" in the thumbstick-events with "HUD", because that's the name of the layer on which the controls are..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 26, 2015 12:34 am

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.

https://www.dropbox.com/s/6wk7afjjwreeh ... .capx?dl=0
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Tue May 26, 2015 9:07 am

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?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 26, 2015 4:00 pm

Ah...

Now this is what I'm talkin about!

https://www.dropbox.com/s/kw1ztrpjcuoab ... .capx?dl=0

Thanks Stain. Do you recommend any other improvements?
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Tue May 26, 2015 4:17 pm

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

https://dl.dropboxusercontent.com/u/485 ... anges.capx

Not sure if it's better or to your liking, you could always change some settings..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Sep 07, 2015 2:46 pm

Thank you for that thread !
B
3
Posts: 1
Reputation: 177


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest