-
Notifications
You must be signed in to change notification settings - Fork 50
Blog post for gameboy assembly #68
base: master
Are you sure you want to change the base?
Conversation
RamZallan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a GitHub repo for this project, could you link it?
| - projects | ||
| description: Sprite movement, joypad input, and box collision in Gameboy assembly | ||
| image: https://github.com/RebeccaSyria/gbc/blob/master/screenshots/2018-04-12-161539_542x523_scrot.png | ||
| image-sm: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove attributes you don't use in the metadata
| --- | ||
| Gameboy assembly is an assembly programming language for the gameboy and gameboy color systems. The instruction set is extremely similar to that of the z80 processor, however there are a handful of differences in the way that input and output are handled. Over the past several months I have been learning gameboy assembly, and currently have a working demo in which a sprites can be displayed, moved with the joypad, and collided with each other. | ||
|
|
||
| Sprite Display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change these to normal Markdown headers (# Text here)
|
|
||
| Box Collision | ||
| --- | ||
| Collision in assembly is done in the same way collision is done in most other languages, by comparing coordinate values of two sprites against each other. The way I did this was by making a function that takes in the x or y coordinate from each sprite in the a and c registers, and then use another register, in this case I used the b register, to keep track of how many iterations of comparison has been done, and each iteration the coordinate of one of the sprites is decremented, so it is compared against the entire edge of the sprite. When a collision is detected, 0 is loaded into the b register and the function returns, if no collisions are detected 1 is loaded into the b register and the function returns. The b register is then compared to 0, and the action that takes place on collision is then done. In this case, I had the first sprite push the second sprite on collision, so it jumps to a function in the program that moves the second sprite in the same manner as the first sprite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe surround the letters of registers (i.e. a, b) in `s, just to differentiate betw. the text.
|
Looks good to me, cool project! |
No description provided.