User Tools

Site Tools


notes:cprog:spring2025:projects:mtb3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:cprog:spring2025:projects:mtb3 [2025/03/05 18:44] – [brick field] bdildinenotes:cprog:spring2025:projects:mtb3 [2025/03/05 18:48] (current) – [array of bricks] bdildine
Line 29: Line 29:
  
 ====array of bricks==== ====array of bricks====
 +You can use an array of boolean values to check if the box has had a collision or not. This would look something like:
 +<code>
 +bool[#ofboxes] Boxes;
 +</code>
 +You can make use of for loops to initialize every value in the array to true or false.
 +Then when drawing the boxes, use a for loop and only draw each box if the corresponding value in the boolean array is true or not
 +( This would assume when the ball collides with the box you set that boxes boolean value to false )
  
 ====brick ball collision detection==== ====brick ball collision detection====
notes/cprog/spring2025/projects/mtb3.1741200266.txt.gz · Last modified: 2025/03/05 18:44 by bdildine