User Tools

Site Tools


haas:fall2021:c4eng:projects:brickify

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
haas:fall2021:c4eng:projects:brickify [2021/10/05 21:06] – [Block processing code] wedgehaas: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 code editor (hit ESCAPE from the command-line/rainbow screen) 
-  * go into the sprite editor:+    * clear out the sample/demo code (CTRL-a then backspace or delete) 
 +  * go into the sprite editor (click the PACMAN GHOST in the upper left):
     * select foreground sprites     * select foreground sprites
 +
 +{{ :haas:fall2021:c4eng:projects:spritenav.png?200 |}}
 +
       * 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
 +
 +{{ :haas:fall2021:c4eng:projects:sprite257.png?200 |}}
 +
       * 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
 +
 +{{ :haas:fall2021:c4eng:projects:sprite258.png?200 |}}
 +
       * 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)
-  * proceed back to the code editor to input the code+ 
 +{{ :haas:fall2021:c4eng:projects:sprite259.png?200 |}} 
 +  
 +  * proceed back to the code editor to input the code (click the open/close square brackets in top left)
  
 =====Header and support function===== =====Header and support function=====
Line 148: Line 161:
 // //
 </code> </code>
 +
 +{{:haas:fall2021:c4eng:projects:tic80brickstruct.png?200|}}
  
 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:
 // //
 </code> </code>
 +
 +{{:haas:fall2021:c4eng:projects:tic80blockarrayfill.png?200|}}
  
 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> 
 + 
 +{{:haas:fall2021:c4eng:projects:tic80ballbrickcollision1.png?200|}} 
 + 
 +<code javascript>    //////////////////////////////////////////////////////////////////////////
     //     //
     // Only check if the asset is considered active     // Only check if the asset is considered active
     //     //
  
 +</code>
 +
 +{{:haas:fall2021:c4eng:projects:tic80ballblockcollision2.png?200|}}
 +
 +<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.
 +
haas/fall2021/c4eng/projects/brickify.1633467963.txt.gz · Last modified: 2021/10/05 21:06 by wedge