dylan-mcleod / FLC-Breakout

Breakout-inspired game to be made by the FLC++ Programming Club
0 stars 0 forks source link

Collision/bounding boxes #2

Open Cash120 opened 6 years ago

BlackbirdRocks commented 6 years ago

`@@ -0,0 +1,37 @@

variables

isBallHit = true; brickBottom top brickLeft brickRight Ballx Bally Balldx Balldy

if(Ballx <= brickRight && Ballx >= brickLeft): { isBallHit = true }

else: { isBallHit = false }

for step in range (): testx = Ballx - step(Balldx) 0.005 testy = Bally - step(Balldy) 0.005

if(testx > brickRight): side = right break elif(testx< brickLeft): side = left break

if (sideHit == up || sideHit == down): { ball dy = ball dy }`