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

0 favourites
  • 5 posts
From the Asset Store
Animated Counter
$3.60 USD
10% off
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • 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

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

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

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

    Thanks again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)