Discuss Scratch

dhamilton82
Scratcher
32 posts

Help with Breakout game

I'm trying to make a breakout game where you have a paddle and try to break blocks by hitting a ball into them with the paddle. However, when the ball bounces (off of anything), it doesn't look right. Also, when it bounces off of a block, it always goes to the same place and doesn't always delete the block. Could someone tell me what I'm doing wrong? Here is the link to my project: https://scratch.mit.edu/projects/492553262
AksharPremnath
Scratcher
500+ posts

Help with Breakout game

Every Block Sprite:
when green flag clicked
if <touching [Ball v] ?> then
hide
end

ndsawer
Scratcher
44 posts

Help with Breakout game

Looks ok to me, but I will say this, make a sprite (invisible one) to represent the ground an once you do that, do
if <touching [ground v] ?> then
stop [all v]
end
it might not be what you're looking for, but it's a thought.

Last edited by ndsawer (March 2, 2021 16:54:08)

AksharPremnath
Scratcher
500+ posts

Help with Breakout game

If that won't work then change
hide
to
switch costume to [Blank v]

To make the Blank costume, make a new costume in the Costumes Editor and leave it blank.
deck26
Scratcher
1000+ posts

Help with Breakout game

First thing to do is centre the costume for the ball or set it to no rotation as that's part of why it looks wrong. The ball turning may also mean it no longer touches a block so the if the block clone then checks for touching it won't be deleted.

Secondly, turning 180 degrees is not a sensible bounce unless you're hitting something perpindicular to its face. See my demo at https://scratch.mit.edu/projects/99412537/

That may not fix everything but should be a good start.

Powered by DjangoBB