Coin-coin le Canapin's Recent Forum Activity

  • Hi !

    I've set up this. It works very well with sprites.

    However, there is an error message when I try to paste a tilemap into the canvas.

    [quote:18bf1g9p]Javascript error!

    Uncaught TypeError: Cannot read property '0' of undefined

    http://localhost:50000/Tilemap_plugin.js, line 204 (col 20)

    Any idea how to fix that ?

    edit : okay I've got this : plugin-canvas_p845147?#p845147

    So, is there any way to know how much a tilemap is overlapping a sprite with webGL on ?

  • Hi.

    I would to set up default controls. QWERTY and AZERTY (french layout).

    What is the best way to set up these default controls ? By returning the browser language? Another way ? How could I achieve this ?

  • Some of your gifs kind of mesmerize me and I can't look away. They are, I would say, deeply erotic.

    Guess which ones.

  • If you're going to bend grass, maybe you can take a look to the skew/skend effect by Somebody :

  • I don't know the Physics behaviour that well, so if there is another way to do it, I really don't know. But if your works I guess its fine. But what if two tiles are equal range, won't it bug? for instant if you shoot in the corner below where your shot is on the pictures, then the bottom tile and the right tile will be of equal range, or don't you calculate it that precise, so its not likely to happen?

    I did some tests about it and you're right, it doesn't work the right way.

    Here the projectile collides with the purple square but the detected closest square is a green one.

    [attachment=0:13dqkpft][/attachment:13dqkpft]

    I guess I could instead check for the distance between each tile and the projectile instead of the tile behind the projectile. I should just be sure that I won't use the projectile center coordinates because the tiles origin is, if I'm not wrong, on their upper left corner. Or something like that. That's too bad there is no straightforward solution to this…

  • oops, same post.

  • Maybe you can take a look at this, it may be useful (or maybe not, but that's still a good thing to know

  • I did some tests and it appears that with the physics behavior, a projectile will bounce without overlapping the tile so in this case your solution won't work.

    While using the physics behavior, I managed to target the closest tile on my project -with the surrounding tiles thing- but I increased the projectile speed and now it's less accurate.

    Most of the time it works :

    [attachment=0:1mxo79dp][/attachment:1mxo79dp]

    Some of the surrounding tiles (under the blue overlay square) aren't empty so I can target a closest non empty tile when the projectile collides with the wall. The red square is the returned tile from the projectile position with positionToTile.

    But sometimes, quite often, it won't work with my fast projectile :

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

    The tile returned from the projectile coordinates is one tile farthest from the green wall than it should be.

    No surrounding tiles are overlapping the green wall so my events won't work because it needs to target a close non empty tile.

    I avoided this new issue by increasing the radius of the tested surrounding tiles from 1 square :

    [attachment=1:1mxo79dp][/attachment:1mxo79dp]

    Now I can find the closest tile that is not empty.

    That's an ugly solution thought

  • Can you share your capx ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do you think it works with phycics behavior where, I think, the bullet wouldn't overlap the tiles but just collides with it ?

  • Well, neither of your instructions work for me. What could I do wrong ?

    edit : nevermind, found it.

  • Well I think i managed to do it after too much hours because my brain can't handle so much X and Y.

    http://canapin.com/construct/tolilo/10/

    On a collision, it tests every tile in a square of 1 tile around the tile at impact if they are not empty (blue squares).

    Then it tests the distance between these tiles and the tile at the impact. The shortest distance leads to the closest tile (red one).

    I used dummy sprites instead of directly using the tiles data (X and Y) because it was easier for me to understand how it works visually.

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

  • 14-Year Club
  • Email Verified

Progress

15/44
How to earn trophies