IBCS1 - 1718 - June
From WLCS
Revision as of 16:16, 26 June 2018 by Admin (talk | contribs) (Protected "IBCS1 - 1718 - June" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading])
Tuesday - Thursday (6/5/18 - 6/7/18)
Agenda:
- Demo any missing assignments (e.g. Brick class, Brick collision, etc.)
- IBCS2 Summer Assignment
Friday (6/1/18)
Agenda:
- TURN IN FINAL EXAM EXEMPTION SLIPS!
- Demo Brick assignment (row of flashing bricks using the test main code below)
- Brick collision assignment
- Now that you have Bricks that can display, implement the following methods in the Brick class:
- boolean hitTop(Ball b) - returns true if the Ball b's bottom edge hits the top side of a visible Brick (i.e. check for visibility too); return false otherwise (HINT: You basically have this method already done...)
- boolean hitBottom(Ball b) - returns true if the Ball b's top edge hits the bottom side of a visible Brick (i.e. check for visibility too)
- boolean hitLeft(Ball b) - returns true if the Ball b's right edge his the left side of a visible Brick (i.e. check for visibility too)
- boolean hitRight(Ball b) - returns true if the Ball b's left edge his the right side of a visible Brick (i.e. check for visibility too)
- To demonstrate this assignment, modify the Brick test code that was given to you, so that the row of Bricks no longer blink. Instead, add if-statements to check if the ball hits the top OR bottom of a visible Brick, then turn the Brick invisible and reverse the ball's dy. If the ball hits the left or right of a visible Brick, then turn the Brick invisible and reverse the ball's dx.
- Now that you have Bricks that can display, implement the following methods in the Brick class: