How do I make 3 shots for a angry bird style game

Get help using Construct 2

Post » Tue Jul 12, 2016 11:09 pm

i am using the basic demo that is with the C2 but im trying to figure out how to allow the player to have 3 shots instead of one. ive tried playing with variables but no good. please help
B
7
S
2
Posts: 105
Reputation: 889

Post » Wed Jul 13, 2016 5:36 am

What have you set up that limits your player to having one shot?

Everything that defines what one can or cannot do is a condition. You're on the right track with variables.

For example, add a variable ShotsLeft=3

Your condition for firing would include System compare variable - ShotsLeft>0.
And your action for firing would include System subtract from - ShotsLeft.

Or you can have an event for after firing, if shots left is more than 0, then reset/reload the next shot.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Wed Jul 13, 2016 6:51 am

thanks for the reply. here is my event sheet.

Image

its the basic physics catapult game in C2 but cant seem to make 3 shots
B
7
S
2
Posts: 105
Reputation: 889

Post » Wed Jul 13, 2016 9:03 am

There is a communication issue here.
What exactly do you mean by "make 3 shots" ?

Do you mean you want the player to be limited to 3 attempts at shooting or do you mean for the player to shoot 3 projectiles at the same time ?

As you stated this is the basic code from the example.
That example does not contain any limitations about the number of shots the player can take.
If you want to limit to 3 total shots, then simply add this limit yourself.
Add a global variable "ShotsFired".

In event "On touch end" Add 1 to ShotsFired.
In Event "isAiming = 1" add a condition to check that ShotsFired is less than 3.
This will limit your player shooting more than 3 times.

This is because of how events work.
The event sheet is read from top to bottom, the conditions for each event are checked, and if they are true the actions are executed.
If any condition of the event is false the actions are not executed and the sub events for this event are ignored as well.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
293
S
117
G
96
Posts: 7,310
Reputation: 71,069


Return to How do I....?

Who is online

Users browsing this forum: koops and 8 guests