This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:cprog:spring2025:projects:mtb4 [2025/03/13 03:42] – [power ups] bdildine | notes:cprog:spring2025:projects:mtb4 [2025/03/13 03:45] (current) – [power ups] bdildine | ||
---|---|---|---|
Line 60: | Line 60: | ||
then create a struct with the desired powerup and position: | then create a struct with the desired powerup and position: | ||
+ | < | ||
void main() | void main() | ||
{ | { | ||
Line 68: | Line 68: | ||
| | ||
} | } | ||
+ | </ | ||
now everytime that you call ptrPowerup-> | now everytime that you call ptrPowerup-> | ||
- | // | + | |
Some Power-Ups you could make could range from trivial to more difficult. One could be a Power-Up that increases the size of your paddle. | Some Power-Ups you could make could range from trivial to more difficult. One could be a Power-Up that increases the size of your paddle. | ||
You can accomplish this by checking if the Power-Up is active, then selecting a different region before drawing the paddle and the given coordinates. | You can accomplish this by checking if the Power-Up is active, then selecting a different region before drawing the paddle and the given coordinates. | ||
Line 84: | Line 84: | ||
draw_region_at( PaddleX, PaddleY ); | draw_region_at( PaddleX, PaddleY ); | ||
</ | </ | ||
- | // |