This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:discrete:fall2023:projects:ttb1 [2023/09/17 21:30] – [BITWISE OR] jwieland | notes:discrete:fall2023:projects:ttb1 [2023/09/21 01:40] (current) – [LARGER PADDLE] cfoster8 | ||
---|---|---|---|
Line 36: | Line 36: | ||
It checks if the either of the two inputs are not zero and gives a 1. | It checks if the either of the two inputs are not zero and gives a 1. | ||
- | ^ 12 ^ 6 ^ 6|12 ^ | + | ^ 12 ^ 6 ^ |
| 1 | | | 1 | | ||
| 1 | | | 1 | | ||
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 " | + | Bitwise XOR uses the " |
- | It checks | + | |
+ | ^ 12 ^ 6 ^ 6 or 12 ^ | ||
+ | | 1 | | ||
+ | | 1 | | ||
+ | | 0 | | ||
+ | | 0 | | ||
+ | |||
====BITWISE NOT==== | ====BITWISE NOT==== | ||
Bitwise NOT uses the " | Bitwise NOT uses the " | ||
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' | ||
====INVINCIBLE BALL==== | ====INVINCIBLE BALL==== |