How do I fix a bullet counter from freezing/getting stuck?

Get help using Construct 2

Post » Sat Jul 19, 2014 11:14 pm

Hi,

I am working on a touch-based game for windows 8.1/windows phone 8.1 with similar movement and aim/fire mechanics as Halo Spartan Assault.

At this point I've already figured out the movement and look/aim controls using two touch-joysticks (thanks to a touch controls tutorial by Jayderyu).

For shooting I've implemented a counter for bullet delay (to thwart continuous fire) in which when the user Is touching the right analog "fire" stick the System Adds 10 to BulletDelay (the counter). When BulletDelay reaches 20 the player Spawn's the Bullet and an Audio blast sound is played. Following the shot and BulletDelay reaching 100 the counter is reset to 0. Also I thought that I should mention that when the bullet reaches the boarders of the screen it is destroyed when it comes in contact with a "bullet barrier".

The problem that I am having is that the BulletDelay counter freezes when testing the fire mechanics and a steady stream of bullets and a constant bullet sound plays. I've tested this on my tablet (Nokia Lumia 2520), my laptop (through Internet Explorer 11), and my phone (Nokia Lumia 1520).. and all devices have the same problem. Also, yes I am exporting the project to VS Express 2013 for Windows.

If anyone has any experience dealing with this type of a problem I'd appreciate the help. I am currently running Construct 2 release 173 (32-bit). Maybe this is a bug within Construct 2 and I should implement the firing mechanics differently?

Thanks for any help given,
CyberAbyss
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 3
Reputation: 606

Post » Sat Jul 19, 2014 11:23 pm

Correct me if I'm wrong..
Every tick 10 is added to the bullet delay..
If the game is 60fps the bullets will fire every ten ticks, so thats 6 bullets per second..
i guess the audiosample is longer than 1/6th of a second..
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 » Sat Jul 19, 2014 11:47 pm

LittleStain,

Should I change the amount added?.. and when it fires/resets?
The problem persists with or without the audio. As far as the length of the audio sample, I don't have any way of knowing at the moment windows will only show 00:00:00.. I'd have to get that information from soundbooth or the likes later.

Thanks
B
3
Posts: 3
Reputation: 606

Post » Sat Jul 19, 2014 11:51 pm

You don't have to change anything if six bullets a second is what you are aiming for..

But I'd replace the every tick action with something like

is touching button
every 0.2 seconds - spawn bullet

or something like that..
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 » Sun Jul 20, 2014 12:04 am

Ok, thanks for the suggestion. I'll try that method and see if the problem persists.

Update:
So far so good.. An easy solution too.. :oops:

Thanks again!
B
3
Posts: 3
Reputation: 606


Return to How do I....?

Who is online

Users browsing this forum: dop2000, draiza, Yahoo [Bot] and 12 guests