| CSE306 | Processing Systems and Structures | Lockwood, Spring 2003 |
|
|
Bill Ntwali: Movement and Player Display
Chilumba Mubashi: Interrupts & Equations T.J Peterson: Graphics Jian Gao: Text Mode & Random Generation |
|
|
28th April, 2003 |
In the game of soccer, when both scores are tied there is a penalty kick off. This project will consist of a player kicking penalty kicks. The design is to have a player kicking the ball into the goal and a goalkeeper trying to catch the ball. Every time the ball goes into the goal, we update the score by 1 point on the kicker's team. If the kicker misses, we update the scoreboard with a zero for the kicker's team and a one for the goalkeeper's team. After five kicks, we will check the scoreboard to see which team won the game. Ex. If the kicker only makes 2 out of 5 kicks into the goal, the goalkeeper's team will have 3 points and the kicker's team will have 2 points. The score will show the goalkeeper's team won the game.
Interrupts will be used for real-time calculations. The time interrupt will be used to allow position update so that the ball can move. Keyboard interrupts
by the arrow keys will be used for the goalkeeper's movements.
Our program will use both text and video modes.
1: Kicker initial position
2: Ball initial position
3,4,5: Various goal keeper positions
Problem Description
One of the major hurdles we foresee is that of incorporating mode 13h since we have not formally covered the topic in detail in class.
Another bigger hurdle is that of putting all the project members procedures into complete code that will work.
A challenge we also see is that of having the ball move and at the same time have control of the goal keeper to move as well.
From a given ball start position (position 1 on the diagram), a calculation has to be made to move the ball in a straight line to either the
left (position 4) the center (position 3) or the right hand side (position 5). To calculate the position of the ball at each instant of time the
ball moved, the equation below would be usey = mx + c
where y is the horizontal position, m is the slope, x the vertical position, and c the y-axis intercept, which is just a constant. So depending
on the direction the ball is being kicked, y would be updated by the values of the variables calculated making a triangle.
Description: In order for the ball to move, it has to be
kicked by the kicker. This routine should make the kicker move forward
and kick the ball once the “ Enter” key is pressed. The initial position
of the kicker is the bottom center of the screen, marked position 1 on
given diagram above.
The procedure will also require an initial ball position input.
Inputs: cl=char to display, dl=row,dh=col, ah=color
Text mode helper procedure which right a char with the given input attributes
displayed to the screen.
Procedure to draw the outline of the score board.
The outline is a character width boarder around a 80 x 25 text mode
screen
OpenAllFile, CloseAllFile (By T.J. Peterson)
SetPalette ( By T.J. Peterson )
Sets the palette for image display
DrawMovPic (By T.J. Peterson)
Draws the non-background pictures(e.g. goalie, ball, numbers, etc)
Before calling the procedure,
move to di the position
on the screen where the keeper needs to be
move to bx the offset (Buffer
holding image bytes)
add to bx the (file size
- image width)
move to cx, (Image width
* image height)
move to currentWidth, the
image's width
ImageData ( By T.J. Peterson, arranged by Chilumba Mubashi)
Loads the images into memmory
All the registers are preserved
We will have the 'lib306.lib'
library available at hand.
There has not been a need
for other library yet.