Excal's Forum Posts

  • This is mostly a Javascript/Canvas question and not a Construct 2 question. Perhaps this is best directed towards the C2 developers since they have built an option to enable or disable WebGL in C2 if the browser supports it.

    I've made a few HTML5/JS demos using canvas before, but I have never enabled WebGL acceleration for them to speed them up. Could someone who is knowledgeable on this explain how WebGL can be enabled for your canvas-based app if the browser supports it? Is there a library (like modernizr, which detects for canvas capabilities) that simply allows you to 'turn on' WebGL acceleration if the browser is capable?

  • This is an issue I have because I am participating in it as well.

    It seems like the game jam is designed to greater emphasize mobile (touch) games being made with C2 in order to spur that side of C2 game development, but the problem is that performance on mobile is really lacking.

    If we could post some benchmarks here, that would be great. For example, my game right now has an estimated memory usage of 25mb. I haven't tested it on mobile yet, but it would be nice to know how my memory usage might impact performance, and what a better memory usage amount would be for a smoother experience.

  • Thanks (again) vee!

    I actually was able to piece together a solution just before your post, haha. I am just now getting used to using dt (it's not really a 'natural' thing for me to think of using yet), so bear with me as I slowly learn more of this advanced stuff.

  • This is true, but trust me, if there's no slowdown things get out of control pretty fast!

    I don't want to force players to have to use the brake key except as an emergency brake kind of thing.

  • Game updated again! Give it a try!

    Added some music, replaced some of the placeholder sound effects, enemies now fire at variable rates, and general bugfixes all around.

  • I'm not a fan of setting it up in the properties bar because some conniving coder could change it and 'cheat'.

    By setting it dynamically through an event, I prevent most attempts to 'cheat' the game.

    I'm not sure what subtracting random(3) does. Could you explain the logic behind that?

  • <img src="http://i.imgur.com/KY4qh3H.png" border="0" />

    I have it so that after the enemy is created, it has its firerate and fire set, so yes.

  • <img src="http://i.imgur.com/8wYgTDZ.png" border="0" />

    Now the enemies aren't firing at all :/

    Do I need to be picking each instance? I tried a For-Each and ran into the same problem.

  • Pixel, that makes perfect sense, thank you!

    As for my sharing my .capx file, all art assets I'm using is placeholder anyway so I'm fine sharing it for now.

  • Here's my project file in case you want to look.

    SpaceGame.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Interesting examples, but I'm not sure how to apply it to my program.

    I don't have a global variable that allows you to "artificially" set variable firing rates, I have enemies on screen that equal the current wave (level) and each enemy should be firing at a different rate. I am not given the luxury of using a global variable to divide by, as I need the firing rates to be random.

    If you take a look at my screenshot above, you can get a general idea of what I am trying to do. I need the enemies to be firing equal to their fire rates.

  • They're still firing at the same rate. What you have essentially done is change which ones fire.

    I need all my enemies to be firing, but at different rates.

  • I have an instance variable that stores the fire rate for each instance. This instance variable is assigned a value every time the object is created, but I'm still having the issue where the objects fire at the same rate.

    <img src="http://i.imgur.com/YgfiIIb.png" border="0" />

    Can't think of another way that 'should' be correct, and what I have isn't creating different fire rates. Anyone have any ideas?

  • Here's an update of what I've done based on vee's feedback, but now I'm getting the issue where one enemy ship seems to be firing and the others don't fire at all.

    Occasionally I get the error where enemy ships have a fire rate that is insanely high, like 0.1 or something, which shouldn't be possible because the default fire rate is zero. Any ideas why this might be happening?

    <img src="http://i.imgur.com/OmhMRfr.png" border="0">

    SpaceGame.capx

  • I don't think that solves the problem, because in essence that's exactly what I have already done that isn't working.

    I'm setting the firerate in the For-Each loop that creates each ship sprite.