I already did the bullet mechanism, but i can’t seem to shoot the wall like in Battle City/Tank Battalion. Can someone help me?
p.s : i’m making a pixel tank shooter game
I already did the bullet mechanism, but i can’t seem to shoot the wall like in Battle City/Tank Battalion. Can someone help me?
p.s : i’m making a pixel tank shooter game
Hi, what exactly doesn’t work? The destructible walls need to be built of single blocks that disappear when colliding with the bullet. The size of the blocks depends on your game.
There are two bomberman examples which could give you perhaps some inspiration:
https://editor.gdevelop.io/?project=https://resources.gdevelop-app.com/examples/bomb-the-crate/bomb-the-crate.json
can try this example I made you need to add a point to the tank where the bullet is created and change the origin to the centre of the tank. next change the origin and centre points of the bullet. see below for reference
example
tank points
bullet points
events
um sorry if you think i’m being rude, but i need to destroy just a line (1/4 of the block height/width). not the entire block. like this one
you can use an extension called Masking objects or make your own if you have a solid colour background. you could add a solid object over the top of the brick wall starting at 0 height/width and when bullet is in collision with wall increase the the height/width of the solid object.
can i have the code? i’m an amateur so i haven’t tried extensions
here is an example what I did is cut the wall object into 4 objects and placed vertically for one wall and horizontally for the other wall. when the bullet is in collision it will delete one of the objects that makes up the wall. the issue with this is if the tank is shooting vertically at a horizontal object it will delete horizontally see example for reference
example
scene
events
sadly this is not what i was looking for.
i need the tank to shot both vertically and horizontally
the example is pretty good but i really need to do it
sorry in advance
can you fix the issue tho?
can’t fix example it would require a fundamentally different solution I think you would have to take into account tank direction but not sure how to delete both vertically and horizontally. hopefully someone can help you out.