User Tools

Site Tools


notes:discrete:fall2023:projects:ttb1

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:discrete:fall2023:projects:ttb1 [2023/09/17 23:30] – [BITWISE XOR] mfee1notes:discrete:fall2023:projects:ttb1 [2023/09/21 01:40] (current) – [LARGER PADDLE] cfoster8
Line 44: Line 44:
 In this example the result of 12 or 6 is 14. In this example the result of 12 or 6 is 14.
 ====BITWISE XOR==== ====BITWISE XOR====
-Bitwise XOR uses the "^" symbol.  +Bitwise XOR uses the "^" symbol. Returns 1 only if the 2 bits are different. 
- +
-Returns 1 only if the 2 bits are different. +
  
 ^        12      ^        6        ^       6 or 12         ^ ^        12      ^        6        ^       6 or 12         ^
Line 58: Line 56:
 Bitwise NOT uses the "~" symbol. Bitwise NOT uses the "~" symbol.
 It inverts all the bits in a single number. It inverts all the bits in a single number.
 +
 +^        12      ^          ~12         ^
 +|        1        |          0          |
 +|        1        |          0          |
 +|        0        |          1          |
 +|        0        |          1          |
 =====POTENTIAL FEATURES===== =====POTENTIAL FEATURES=====
  
 ====LARGER PADDLE==== ====LARGER PADDLE====
  
 +To make a larger paddle, all you'd have to so is extend your paddle collision to double the length of your paddle and draw a second paddle where the first one ends, or alternatively use a different paddle sprite
 +
 +You can use the same select region to draw both paddles, like so
 +    select_region( Paddle );
 +    draw_region_at( PaddleX, PaddleY)
 +    draw_region_at( PaddleX + [paddle length], PaddleY)
 +Where [paddle length] is the length of the paddle
 ====PADDLE MAGNET==== ====PADDLE MAGNET====
  
 ====BRICK HIT POINTS==== ====BRICK HIT POINTS====
  
 +To code in multiple hit points for bricks, your brick struct should include an integer member for HP and visibility.
 +
 +Within your calculations for ball-brick collision, make a check to see if the current brick is visible (if not, do not process collision detection). If collision is detected, decrement the brick's HP. If HP is 0 after it is decremented, then toggle the brick's visibility. 
 ====INVINCIBLE BALL==== ====INVINCIBLE BALL====
notes/discrete/fall2023/projects/ttb1.1694993450.txt.gz · Last modified: 2023/09/17 23:30 by mfee1