1 / 8

Block Collision and Destruction

This text explores the concepts of block collision and destruction in a screen or display, including screen/display coordinates, memory addressing, and bit shifting. It discusses how these concepts are applied to a memory block structure and the process of identifying collisions and removing blocks.

mosesn
Download Presentation

Block Collision and Destruction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Block Collision and Destruction

  2. Three Concepts • Screen or Display coordinates • Memory Addressing • Bit Shifting

  3. 01010000000 11 bits 11 bits 00111100000 Display Concepts 640 (x,y) 480

  4. Memory Memory 10-bit Address Bus 1-bit Data 1024 bits of memory

  5. Bit Shifting • Blocks are 32 by 16 or … 2^5 by 2^4 • Can fit 20 blocks across the top of the display and stack them 30 deep 32 (100000) 16 (10000)

  6. 11 bits Ball X coordinate 00010100110 Address 0010100000 10 bits Combining it All • Ignore the 5 least significant bits of the X coordinate of the ball. • Take the remaining next 5 bits of the ball X coordinate and map them to the top five bits of the memory address

  7. 11 bits Ball Y coordinate 00110100010 Combining it All • Ignore the 4 least significant bits of the Y • Map the next 5 bits of Y coordinate to the bottom 5 bits of the memory address Address 0010100110 10 bits

  8. Collision • Use the address to access memory • If the Data is one, there is a block in the same space as the ball • Signal a collision and write a ‘0’ to remove the block

More Related