This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2021:c4eng:projects:brickify [2021/10/05 19:23] – [Brick struct] wedge | haas:fall2021:c4eng:projects:brickify [2021/10/07 18:34] (current) – [Block processing code] wedge | ||
---|---|---|---|
Line 15: | Line 15: | ||
* open up TIC-80 | * open up TIC-80 | ||
- | * clear out the sample/demo code (CTRL-a then backspace or delete) | + | |
- | * go into the sprite editor: | + | |
+ | * go into the sprite editor | ||
* select foreground sprites | * select foreground sprites | ||
+ | |||
+ | {{ : | ||
+ | |||
* in #257: draw an 8x4 paddle tile, going from edge to edge, and only using the top 4 rows of the tile | * in #257: draw an 8x4 paddle tile, going from edge to edge, and only using the top 4 rows of the tile | ||
+ | |||
+ | {{ : | ||
+ | |||
* in #258: in the top left of the tile, draw a 2x2 ball tile | * in #258: in the top left of the tile, draw a 2x2 ball tile | ||
+ | |||
+ | {{ : | ||
+ | |||
* in #259: from the top left of the tile, draw a 7x4 brick tile (using only the first 4 rows) | * in #259: from the top left of the tile, draw a 7x4 brick tile (using only the first 4 rows) | ||
- | | + | |
+ | {{ : | ||
+ | |||
+ | | ||
=====Header and support function===== | =====Header and support function===== | ||
Line 148: | Line 161: | ||
// | // | ||
</ | </ | ||
+ | |||
+ | {{: | ||
The actual definition of the brick will be part of class interactions. | The actual definition of the brick will be part of class interactions. | ||
Line 160: | Line 175: | ||
// | // | ||
</ | </ | ||
+ | |||
+ | {{: | ||
This actual process will be part of class interactions. | This actual process will be part of class interactions. | ||
Line 238: | Line 255: | ||
} | } | ||
- | //////////////////////////////////////////////////////////////////////////// | + | |
// | // | ||
// Display the paddle, compensating for width of desired sprite | // Display the paddle, compensating for width of desired sprite | ||
Line 357: | Line 374: | ||
<code javascript> | <code javascript> | ||
- | //////////////////////////////////////////////////////////////////////////// | + | |
+ | | ||
// | // | ||
// Ball-block collision detection - we have to check the ball against | // Ball-block collision detection - we have to check the ball against | ||
Line 364: | Line 382: | ||
// | // | ||
- | | + | </ |
+ | |||
+ | {{: | ||
+ | |||
+ | <code javascript> | ||
// | // | ||
// Only check if the asset is considered active | // Only check if the asset is considered active | ||
// | // | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | <code javascript> | ||
//////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////// | ||
// | // | ||
Line 407: | Line 434: | ||
Once everything is typed in, and tiles are created in their appropriate slots, we can give the program a run and see it in action. | Once everything is typed in, and tiles are created in their appropriate slots, we can give the program a run and see it in action. | ||
+ |