#I need help finishing up a Breakout Clone I made by having the balls collide with the bricks.

9 messages · Page 1 of 1 (latest)

worthy dove
#

I want to finish up this Breakout Clone I made a few months back and I need a good script to add/improve to make the ball break bricks upon collision.

#

sorry for the repost I had forgot to add the screenshots btw

vague ferry
#

you should use the physics bodies (CharacterBody, StaticBody) as root nodes of your scenes, first of all. Get rid of those Node2Ds and attach the script to the physics bodies.

you can add this as line 2 in your brick.gd class_name Brick
and then this in ball.gd at line 14 inside the if block

if collision.get_collider() is Brick:
  collision.get_collider().hit()

or even better remove the script on your bricks completely and just do

if collision.get_collider() is Brick:
  collision.get_collider().queue_free()
#

let me know if it doesnt work or you need some more detailed explanation

worthy dove
#

Thanks!

#

problem

#

what do I do now?

#

Okay update I figured out but now I have a new problem