How do I Make a triple round burst?

Get help using Construct 2

Post » Tue May 10, 2016 1:34 pm

For example, an enemy that shoots Multiple rounds in a single volley, then stops and reloads for some time, and then does that again.
B
6
Posts: 46
Reputation: 336

Post » Tue May 10, 2016 2:46 pm

Hey armour, are you familiar with functions?

If not then the simplest event you could use would be getting the enemy sprite to create a bullet then use the wait action, fire, wait, fire, wait for reload and then repeat.
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Tue May 10, 2016 5:37 pm

I used:

Every x seconds, ammo != 0, reloadtime = 0 | fire bullet, subtract 1 from ammo
Else if ammo = 0 | increment reloadtime by 60*dt
When reloadtime > x | set ammo to clipsize, reloadtime to 0

This was for player controlled firing though, where it is possible to stop in the middle of the clip. Using wait actions in a function would indeed be the simplest.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,697
Reputation: 64,442

Post » Fri May 13, 2016 12:59 pm

fire and wait? there is such thing?
B
6
Posts: 46
Reputation: 336

Post » Fri May 13, 2016 1:30 pm

To use the wait command you have to open an event like

1st select system, 2nd then select wait

Yes there is a wait command but the fire command you do yourself.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Fri May 13, 2016 1:36 pm

Or you can use a timer for the enemy like I did in my donkey kong game where he throws the barrels. Check out the full source code free

donkey-kong-android-capx-file-perfect-hi-score-save_t172621

It also has hi-score saves and other concepts that could help you out.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Fri May 13, 2016 1:50 pm

It's an enemy firing. also, is this new thing in the new version of construct 2? because i dint update yet.
B
6
Posts: 46
Reputation: 336

Post » Fri May 13, 2016 2:03 pm

Armouredank wrote:It's an enemy firing. also, is this new thing in the new version of construct 2? because i dint update yet.


Yes it is in the latest Construct2 and yes I know its an enemy firing but its the same concept code wise as kong throwing barrels just a different object.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Fri May 13, 2016 4:05 pm

oh.
B
6
Posts: 46
Reputation: 336

Post » Fri May 13, 2016 4:07 pm

I couldn't really understand the coding. could you make a false event sheet for me to see?
B
6
Posts: 46
Reputation: 336


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 52 guests