Bullseye!
Bullseye was created in assembly using the program Easy68k over the span of two weeks. The player spawns in a locked room inspired by Zelda: A Link to the Past, where a timer starts and a tricky target swoops by. The player must hit it 10 times before the timer reaches 0. There were many steps to get to this finished project. First was to get the rendering working, then the game loop and input system, then firing the arrow and getting the target to move the way it does. Next was the collision system, then finally the scoring and the timer. These last two were rendered in a specific way with a custom made 7 segment display.
Lining up the shot and firing at the target in Bullseye!
Rendering
Before starting the game, I created the renderer. It involved taking a bitmap file and reading the header that contained the information needed to display the image onto the screen. This includes the width and height of the image, as well as the amount of bytes needed to get to the actual image pixel data of the file. This data all needed to be swapped around due to the way memory is stored in modern computers (little Endian vs. big Endian). If I had each individual pixel being loaded in at once, though it would be rather fast, it would look ugly. The solution would be to create a buffer to draw the images on, wait until all the sprites have loaded in, then swap the buffer to the front of the screen. This however causes the framerate to dip, so we exchange speed for looks.
Collision
I would also like to highlight the collision system that checks if the arrow hits the target. It first checks if the arrow’s tip has reached the constant y position on which the target travels. That prevents checking every frame that the arrow is up if it has hit the target. That takes care of the y value, now if the width of the arrow is inside the target’s sprite, the arrow has hit and the target is deactivated.
*Collision is handled here. It is checked once the y value of the arrow's tip is in the range of the target's constant y value.
*If the arrow is within the horizontal range of the current target's location, then the collision is true
cmp.l d5,d6 ;compare if arrow is past target, if not then skip collide
bgt skipCollide
subi.l #TARGET_CHUNK_HEIGHT,d5
cmp.l d5,d6 ;compare if arrow is before target, if not then skip collide
blt skipCollide
*Arrow is now where the target could be, but now will check if the target is here by checking
*the starting X value of the target's location and how wide it is to see if it is within
*the target
sub.l d7,d2
cmp.l d1,d2
bgt skipCollide
cmp.l d1,d4
blt skipCollide