Coin-coin le Canapin's Recent Forum Activity

  • Not much.

    http://canapin.com/construct/worms/v8/

    Damage calculation has some glitches (with the 2nd weapon), players can't move and some badly optimized events cause too much CPU work.

    Plus, I didn't implemented the proportional particle effect.

    Actually I'm refactoring my engine from A to Z because it was a complete mess. I'll create a thread about it when I have something to show.

    My project is creating a multiplayer game inspirated mostly by Gunbound, which had an incredibly amazing gameplay until the developper ruined it. I could talk about it for hours.

    That said, I've never finished any project, with Construct 2 or not. But I enjoy trying year after year <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • As codah said, you can manually change the X and Y coordinates of your numbers. I made an example file.

  • For example like this

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can compare the enemy position with the main character position on the X axis.

  • I measured the duration of each event using wallclocktime function and clicking like mad, and it appears that the first algorithm is faster.

    0.12s vs 0.15s, the results are constant over my tries.

  • I used wallclocktime and it worked perfectly

    What I'm trying to achieve is a destructible terrain "à la Worms", which counts how much pixels were destroyed in order to generate a proper number of particles.

    I first used a loop using "Canvas.alphaAt(X,Y)" for each pixel contained in the radius of the explosion, but r0j0hound suggested that I could store all the Canvas pixels in an array, and iterate over the array because it would be faster.

    That's what I did and it is indeed faster. I first look at all the pixels contained in the explosion radius. For each pixel, I look at its transparency. If its alpha ≠ 0, then I increases the particle quantity variable then I update my array to replace this pixel with a transparent one.

    So this is this step which is slow, but I don't see how I could optimize this, I need to update all these specific pixels in the array, because I compare my collisions with the pixels contained in the array, not with the pixels currently drawn in my canvas (because it's slower).

    I made a thread about this project :

    The elements have to be updated at once, because in my final game, more than 2 projectiles could hit the landscape quickly in the same area.

    chrisinfinger > Because I only update pixels that were not transparent, I think it already works as a filter, sort of. Am I right ?

  • Hi. I have an event which take some times : like updating thousands of entries in an array. When the event is executed, the computer seems to freeze for a short time.

    Is it possible to know precisely how much time this event takes ?

  • Hi again,

    I used a faster algorithm based on http://www.wikiwand.com/en/Midpoint_circle_algorithm to browse all the pixels contained in the radius of each explosion.

    It's still kind of slow for large radius > 50.

    I'm even not sure there is a noticeable difference :/

    fast algorithm : http://canapin.com/construct/worms/terrain/

    slow algorithm : http://canapin.com/construct/worms/terrain_slow/

    (to be sure the first one is properly updated, clear the cache of this URL : http://canapin.com/construct/worms/terrain/c2runtime.js , ctrl-F5 on Chrome)

    The first seems to be a litter faster than the other one. Anyone notices the same or I just want to believe too much ?

    The slow things is updating all the pixels of the radius explosion in the array and I dont know how I can increase performances for this.

  • korbaach I like the graphics very much

  • I'm pretty sure there is a nicer way to do it, but it works

    It also prevents the sprites to go outside the window on the left and right.

    Edit : sorry, I updaded the wrong file, here is the new and working one !

  • Thank you for your reply

  • Something like this ?

Coin-coin le Canapin's avatar

Coin-coin le Canapin

Member since 22 Dec, 2010

Twitter
Coin-coin le Canapin has 1 followers

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies