Arkapic!


Project by:


Introduction

Imagine a first-person Arkanoid-style game whose object is to uncover pictures rather than just destroy blocks. The playfield will consist of a 3D "well" whose back wall has layers of "blocks," the first of which is a blank, concealing layer.
Underlying layers will portray pictures from several possible categories. By moving a "paddle" around the screen, the trajectory of a ball bouncing between the screen and the playfield will be determined and the stricken tile will be removed. When the player can guess the content of the entire picture the score is stored and a correct guess resets the game.

Problem Description

We used single-buffered Super VGA graphics at 640 x 480 x 8-bit resolution.
Several aspects of this project gave it some unique challenges. First of all, mouse control needed to be implemented for the paddle, which is in the plane of the screen. Additionally, the "ball" was represented as a triangle fan ("T-fan") whose coordinates needed to be scaled to keep it in proper perspective (a good experience since a similar problem was part of the cancelled MP5). This project exposed us to sound card programming for the first time as well.
Other critical functionality includes being able to detect collisions between the "ball" and objects in the game field, namely walls to the right, left, top, and bottom, as well as the back wall (including individual blocks) and the paddle. Determining ball trajectories based on its position in space is likewise important, since the "ball" must not only rebound off walls in a believable manner, but it should also glance off the paddle at different angles depending on which part of the paddle it struck (ball "English").

Implementation

At the core of the game is the main program which invokes supplemental functions for the graphics engine, sound effects, installing interrupt service routines for the timer/keyboard, ball physics, mouse control, and collision detection.
General program flow is described below, but once keyboard and timer interrupt service routines have been installed, the game must initialize the frame buffer, initialize its mouse input routines, load and decompress PCX files into several segments, and initialize sound hardware.
Gameplay works by iterations. A player begins a game with a certain number of balls, one of which begins its initial trajectory. With each iteration, the main program needs to redraw the background, move the paddle coordinates according to the mouse input, move the ball coordinates according to the direction vector, check to see if a collision has occurred, and, if so, respond accordingly to that collision (changing direction vectors and possibly changing blocks on the back wall). These graphics need to be written to the frame buffer. Sounds need to be sent to the sound card.
If a player tells the program to quit or that he wants to enter in a guess for the picture, the code needs to respond to that request. If the player loses a ball (i.e. its Z-coordinate falls outside the playfield range), the total number of balls remaining should be decremented.
A correct guess of the picture causes a score tally and the game is reset to the next round.

Anticipated Data Structures and Variables


Game Flow Procedure by the Entire Team

This function will control the flow of the game, doing everything from loading the introductory sequence to exiting the program.


MIDI and .wav Sound Procedures by Dave Booth

*The MIDI sound in this project will utilize MIDPACK as advised in the ECE 291 class resources. Wave files will be played upon correct guesses, and a MIDI file will be played as a background sound.


Trajectory Calculation, Initialization, Ball Animation and scaling by Stephen Behling

These functions will control the physics of the ball, controlling ball trajectories and movements


Game Graphics Functions by Slawek Ciapala

These functions will comprise the main graphics engine of the game and implement Super VGA graphics modes.


Input, Interrupts, Custom DrawTriangle and Collision Detection by Timur Karatas

These functions will handle mouse input for the paddle and collision detection for the ball in 3D space with the walls, back wall, and paddle. Also, keyboard and timer interrupts will be installed/deinstalled.

External Routines