Skip to content
This repository was archived by the owner on Oct 12, 2020. It is now read-only.

Conversation

@RebeccaSyria
Copy link

No description provided.

Copy link
Member

@RamZallan RamZallan left a 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:
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

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.

@RamZallan RamZallan requested review from csssuf and devinmatte April 12, 2018 22:21
@RamZallan
Copy link
Member

Looks good to me, cool project!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants