I need shooting only one direction

Get help using Construct 2

Post » Tue May 03, 2016 7:30 pm

Hello, get a problem with topdown shooter.
I got "8" for shooting up and "6" for shooting right but if I pressed it simultaneously player shoot in both direction.
And if I make "8+6" input for diagonal shooting it will be 3 shoot at same time.
How make it be the only one(not on screen just shoot one at time)?
B
4
Posts: 3
Reputation: 206

Post » Tue May 03, 2016 8:22 pm

setting Instance variables for bullet timer(make it 1).
Condition for shooting(bullet timer >0).
Set bullet timer 0 every time I shoot and reset bullet timer every 0.2sec
some how solve this poblem=)
B
4
Posts: 3
Reputation: 206

Post » Tue May 03, 2016 8:33 pm

Hey!

I'm not sure how have you created the shooting controls in your game, but if it's very similar to other top down shooter controls you should watch some tutorials how they are made. Just google "top down shooter tutorial construct 2" and you'll find a lot of good ones easily! Since I don't have the needed 500+ reputation, I can not post you the link.

Going to try anyway, I think it doesn't work though...
https://www.scirra.com/tutorials/405/ho ... onstruct-2

Hope this helps!
Jestercraft: Online courses, lectures, workshops and all the tools you need when starting your journey in learning game development & gamification.
B
13
S
3
Posts: 14
Reputation: 810

Post » Tue May 03, 2016 9:35 pm

Heyho I read this tutorial.
This(and similar) examples use 1 button to shoot(mouse or key) I wonna a lot of button to shoot regular bullets in different directions(Binding of Isaac style).
So if I have A for shooting right.
And B for shooting left.
How make it "if I shoot left I can't shoot right at the same moment"
I solve problem like I write earlier but question is still here=).
B
4
Posts: 3
Reputation: 206

Post » Tue May 03, 2016 11:14 pm

Use Else.

If A, shoot right

Else
if B, shoot left.

This can get messy if you are doing diagonal shooting.

Otherwise, I recommend setting an angle for firing direction as a variable, and shoot at that angle. Then you can do 360 degree shooting and not have to worry about shooting multiple directions at the same time.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests