Coin-coin le Canapin's Recent Forum Activity

  • hi.

    I'd like to check if the center of a moving object (default imagePoint) is currently colliding or overlapping the hitbox of another object. How can I achieve this ?

  • Hi. I've set up a custom font on a text element, but it starts loading only when the text is visible, which is ugly because the font suddently change on the screen when it's loaded. Like from Arial to my custom font.

    Any idea ?

  • You can do something like

    system > every 1 sec

    --- system > create object at position (random(0,layout.Width), layout/Height)

    And use another event to make them fall. What kind of fall do you want to achieve? Do they should stop when they have reached a certain distance ?

  • Hi.

    Do you know if there is an efficient way to see if a disk shaped sprite overlaps with a canvas background (all pixels but those with alpha = 0) ? And maybe in which proportions (about how much pixels it is overlapping) ?

    Or maybe just a circle shaped sprite, it will be enough...

  • Funkyy : [attachment=0:2pizyebx][/attachment:2pizyebx]

    korbaach : Indeed it works perfectly with a simple "play", thank you for this suggestion (hard to believe I didn't try...)

    But the question remains : why it doesn't play the first sound when using a "play at" ?

    I play at the current player object, which exists the first time I play the sound in my events. :s

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi.

    I put a sound when we release space or ctrl key, but it never plays the first time. Any idea why ?

    My sounds are preloaded.

  • I managed to properly use the first solution (there was an issue in my previous events) for my falling vehicules and it's accurate enough to land on a 1px tall ground. Thank you very much for your help

  • Thank you.

    When I increases the steps in your file (for example 50 steps), a single projectile fired with the N key creates 3 holes, that's weird.

    I have another question for you !

    As you can see on my capx, the vehicule falls (physic behavior) and stops its fall when it encounters a non transparent pixel.

    I have the same problem I had with the projectiles : because of the fall speed, it doesn't stops on the first non transparent pixel encountered during its trajectory.

    Simply put, it will fall through a thin ground.

    To avoid this issue, I tried your second solution checking each pixel during the trajectory.

    It doesn't work as expected on my file.

    Here, I used this to create a 1 pixel tall blue bar for each pixel during the vehicule fall, but it appears that it doesn't check every pixel during the trajectory.

    [attachment=2:28xq0nyh][/attachment:28xq0nyh]

    The red line is part of the landscape and the vehicule should land on it.

    [attachment=1:28xq0nyh][/attachment:28xq0nyh]

    So, it obviously misses some non transparent pixels on this trajectory, which causes the vehicule to passes through them.

    Any idea about how to avoid that ?

    Last question, this time about my projectile again. So I used your first solution, which is nice. I use 10 iterations.

    I noticed my computer starts to be sluggish with only 5 shots fired on the screen. Is it supposed to be that CPU demanding, or is there some serious optimization work to do in my events ?

  • The first solution suits me well and it's amazingly more accurate than my previous code. I tried the second one but it seems to be very CPU demanding, no way I can use it for my game.

    However, there is still an issue with the first one : the missile still passes through this instead of colliding :

    [attachment=1:2cta8zyl][/attachment:2cta8zyl]

    I tried to increase the loop iterations numbers to 100, 500 or 5000, but it doesn't change anything.

    Any idea ? You can try it on my capx, don't change the current angle and press the N key to shoot at high speed.

    It probably won't be a real issue on the gameplay because we won't shoot at these speed, but I like to learn and understand

  • Thank you very much !

  • Hi.

    I'm working on a game like Worms.

    I'm using the Canvas plugin to create the destructible landscape, but I encounters some difficulties : if the missile moves very fast, it moves through the landscape before destroying it... Any idea how to fix this ?

    You can see what I'm talking about if you change the Y velocity on the fourth condition.

  • This seems to be a little bit simpler. But I don't think you need the else, a variable can't be equal AND inferior to a same value.

    Ah, I did it the same way as zenox98, I'm a bit late.

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