kodetosuccess / Final-Project

Repository for UCMHS Intro to Programming Final Project
0 stars 0 forks source link

brick breaking game: ball & cannon interaction #13

Closed lerazodiaz closed 8 years ago

lerazodiaz commented 8 years ago
  1. the ball and cannon glitch sometimes when the ball doesn't fully bounce off the cannon
  2. the ball and cannon stays attached and blurs when ball glides through the cannon and the mouse is pressed.
atgao commented 8 years ago

you guys originally had

if (C1.Touches(c)) { //if the Cannon touches the cannonball c.vel.y = -c.vel.y; //put the cannonball in the opposite y direction

}

AND

if (C1.Touches(c) && mousePressed) { //if the Cannon touches the cannonball c.velxy = -c.vel.x; //put the cannonball in the oppositex direction

}

which was causing it to glitch. the x direction of the cannonball doesn't need to be reversed, only the y. it's all fixed now