How do I erase tiles on collision with a bullet Please Help

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello,

    In my game I have a bullet, and I need it to where when I hit a tile with my bullet, it erases. I have been trying at this for several hours, I have read the manual, and scoured google for forums on this. I can not find anything

    My events go like this:

    ball: On collision with Tile map > Erase tile (TilemapOneTouch.SnapX(Ball.X),TilemapOneTouch.SnapY(Ball.Y))

    Please help me

    Thank you so much for your time,

    Ian

  • add the event "bullet your using" on collision with "target your using" and add the action destroy "bullet your using" and destroy "target your using" you need to have them as separate sprites

  • Hello, thank you for your response, but I don't think this will work because I am needing to use a tilemap and my bullet does not need to be destroyed.

    Is there any way in which what you are talking about could be modified?

    Thank you, ian

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you need to have all the pieces you want to be destroyed as separate sprites this is an example: https://drive.google.com/open?id=0B0zF1 ... FlaaWxtdGs

    open and run it, then look at the event sheet,

    this is an example of how the tilemap works.

    this is another example: https://drive.google.com/open?id=0B0zF1 ... FlaaWxtdGs

  • Hello, thank you for your response, but I don't think this will work because I am needing to use a tilemap and my bullet does not need to be destroyed.

    Is there any way in which what you are talking about could be modified?

    Thank you, ian

    you need to use sprites not the tilemap

  • you need to use sprites not the tilemap

    I am sorry but that is not correct:

    https://www.dropbox.com/s/bfwr6zs8mmzaf ... .capx?dl=1

    Shoot at a cactus. Press the button to generate a new map when out of cacti to shoot. The collision polygon is a bit too small on them so it mail fail occasionally, that can be changed in the tilemap tools in the C2 editor.

    That is one way to do it with just one tilemap, although for best performance I recommend using two tilemaps. One without collisions for most of the grapics and the other with collision for just the destroyable tiles. This is because only empty tiles do not have collision masks (it is not possible to disable collisions for specific tiles), therefore like in the example I linked to above, the "on collision" event will trigger every tick. If you would disable the second condition of the on collision event in my example which checks what tile the projectile collided with, the bullet would erase the tile on which the player is standing.

    I use something similar for LOS with walls, walls are a separate tilemap from the surface and have collisions plus solid behaviour.

  • Pulstar

    Hello,

    Thank you for your reply. This is exactly what I needed!

    But then I put it into Construct 3, it does not work. Do you know why this is?

    Thank you,

    Ian

  • Pulstar

    Hello,

    Thank you for your reply. This is exactly what I needed!

    But then I put it into Construct 3, it does not work. Do you know why this is?

    Thank you,

    Ian

    it might just be because c3 isnt complete

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