Introduction
Sometimes the stress of college takes over in a student's life and he
just needs to get revenge. We decided to take legal action to aid in the
relieving of stress. Revenge of the Enginerds is that action. The
main goal of this game is to find your ECE (or CS) professors to get revenge.
Once the player finds them, he will pick them up and attampt to throw them
in front of a MTD bus while doging obstacles like O&M trucks, parking
police, other buses, other students, etc. Thus, all stress of the college
life will be released in the termination of the player's dreaded Professor.
Program Operation
This game will be in a 2D top-down perspective. The player can walk anywhere on the screen until he reaches the edge. When the player reaches the edge of the screen, the next screen is automatically scrolled to. There will be many things on a screen at one time, such as buses, other students, O&M trucks, the character, and whatever else we feel necessary. For this game, we will write many AI's for the buses, trucks, people, Professors, etc. We will have algorithims for scrolling and a grid determining where certain objects, (such as the player), can go. A health meter may be implemented to monitor how well the player is doing in his mission. It will run in 320x200x256 vga mode. A timer interupt will be installed to control relative speeds of all objects on the screen at one time, and a keyboard interupt will be installed to determine player control.
Our grid will be comprised of six 320x200 screens that will be scrolled to as necessary. Each will have obstacles in the corner as to eliminate consecutative scrolling and slow game play. Each section of the screen will have different values in the grid to determine what will be allowed cross into it. For example, O&M trucks can go on the sidewalk and in the grass, but not in the road. The player can go anywhere except through buildings and other physical obstacles.
Both an introduction and exit sequence will be included in the game. The exit sequence will vary depending on how the game was ended. MIDI and WAV sounds will be used to enhance gameplay for both music and various sound effects.
Most of our functions will be written in C style assembly to simplify
variable usage. They will be invoked as necessary.
Variables
Timercount--Controls game speed. Incremented in timer interrupt
PeopleSpeed--Speed of people
PlayerSpeed--Speed of player
BusSpeed--Speed of Bus
TruckSpeed--Speed of truck
TossSpeed--speed person tossed
EscPressed--Set if ESC is pressed
SpcPressed--Set if SPC is pressed
OldKeyV--Holds old keyboard interrupt vector
OldTimerV--Holds old timer interrupt vector
PkeyDir--Holds user entered direction for player to move
CurrentGrid--Holds current grid number
PeopleArray--Holds which grid each person is in
TruckArray--Holds which grid each truck is in
BusArray--Holds which grid each bus is in
endgame--tells if game is ended
how_died--tells how player died
meter_changed--set if meter changed
Meter--contains life status of player
BusCount
; counts for graphics
PeopleCount
PlayerCount
TruckCount
TossCount
bounceplcount
bouncepecount
enddrop--contains coordinates of end of drop
dropping--set if person being tossed
persondropped--contains person tossed
Tossdir--contains direction of person tossed
Numdead--contains the # of people killed by buses
Button1_Flag db 0-Used for Joystick Button1
OffPct REAL4 0.5-Used for setting up the Joystick
displ dw 0-Used in the Joystick Algorithims
;WAV Files
BeginWav db 'rumble.wav',0
IntroWav db 'ccrash.wav',0
IntroEndWav db 'feature.wav',0
ScreamWav db 'scream.wav',0
IntroDoNot db 'DONOT.wav',0
;MIDI Files
MainSong db 'Mission.xmi',0
IntroSong db 'Halown.xmi',0
Highway db 'highway.xmi',0
HellBells db 'hellsbel.xmi',0
Winsong db 'champion.xmi',0
MenuSong db 'nine0210.xmi',0
Taps db 'taps.xmi',0
BadBoys db 'Badboys.xmi',0
Gonnafly db 'Flynowg.xmi',0
;PCXfiles
Intro1pcx db 'final2.pcx',0
Intro1Apcx db 'final2a.pcx',0
Intro2pcx db 'final2b.pcx',0
Intro2Bpcx db 'final2c.pcx',0
Intro3pcx db 'final3.pcx',0
Intro4pcx db 'final4.pcx',0
Intro4bpcx db 'final4b.pcx',0
Intro4cpcx db 'final4c.pcx',0
Intro4dpcx db 'final4d.pcx',0
Intro5bpcx db 'final5b.pcx',0
Intro5cpcx db 'final5c.pcx',0
Intro6bpcx db 'final6b.pcx',0
Intro6cpcx db 'final6c.pcx',0
Intro6dpcx db 'final6d.pcx',0
End1apcx db 'end1a.pcx',0
End1bpcx db 'end1b.pcx',0
End1cpcx db 'end1c.pcx',0
End1dpcx db 'end1d.pcx',0
End1epcx db 'end1e.pcx',0
End1fpcx db 'end1f.pcx',0
End1gpcx db 'end1g.pcx',0
End1hpcx db 'end1h.pcx',0
End1ipcx db 'end1i.pcx',0
End1jpcx db 'end1j.pcx',0
End1kpcx db 'end1k.pcx',0
End1lpcx db 'end1l.pcx',0
End1mpcx db 'end1m.pcx',0
End1npcx db 'end1n.pcx',0
End1opcx db 'end1o.pcx',0
End1ppcx db 'end1p.pcx',0
End1qpcx db 'end1q.pcx',0
End1rpcx db 'end1r.pcx',0
Menuipcx db 'menui.pcx',0
Menugpcx db 'menug.pcx',0
Menuqpcx db 'menuq.pcx',0
Instrctpcx db 'Instruct.pcx',0
End1f2pcx db 'end1f2.pcx',0
End1f3pcx db 'end1f3.pcx',0
End1f4pcx db 'end1f4.pcx',0
End1f5pcx db 'end1f5.pcx',0
End1f6pcx db 'end1f6.pcx',0
;Joystick variables
CtX dw 0
;Self Explanatory variables for the counts in the different directions
CtY dw 0
LwRtX dw 0
LwRtY dw 0
UpLftX dw 0
UpLftY dw 0
OffstX dw 0
OffstY dw 0
Butt1 db 0
Butt2 db 0
BothB db 0
Joystickflg db 0 - Variable to determine if the joystick is
being used or not
Messages
crlf db CR,LF,'$'
Leftmsg db 'Left',CR,LF,'$'
Rightmsg db 'Right',CR,LF,'$'
Upmsg db 'Up',CR,LF,'$'
Downmsg db 'Down',CR,LF,'$'
Center db 'Center',CR,LF,'$'
Button1 db 'Button 1',CR,LF,'$'
Button2 db 'Button 2',CR,LF,'$'
MoveLft db 'Move joystick to upper-left and press button 2.',CR,LF,'$'
MoveRt db 'Move joystick to lower-right and press button
1.',CR,LF,'$'
MoveCt db 'Center joystick and press button 1.',CR,LF,'$'
JoyKey db 'Use joystick(1) or keyboard(2): ','$'
PBuf db 7 dup(?) - Temp Buffer
Filenames for screens
screen0 db 'screen0.pcx',0
screen1 db 'screen1.pcx',0
screen2 db 'screen2.pcx',0
screen3 db 'screen3.pcx',0
screen4 db 'screen4.pcx',0
screen5 db 'screen5.pcx',0
Filenames for grids
grid0 db 'grid0.dat',0
grid1 db 'grid1.dat',0
grid2 db 'grid2.dat',0
grid3 db 'grid3.dat',0
grid4 db 'grid4.dat',0
grid5 db 'grid5.dat',0
sprites db 'sprites.pcx',0 - Filename of sprites file
PlayerOffset dw 28800 - Offset of player sprite
PeopleOffset dw 28820 - offset of regular person
dw 28810 - offset of professor
TruckOffset dw 12800 - Truck offsets (up, down, right, left)
dw 12830
dw 12860
dw 12890
BusOffset dw 35200 - Bus offsets ( up, down, right, left)
dw 35200
dw 0
dw 40
PoPoOffset dw 22400 - Parking Police offsets (up, down, right,
left)
dw 22420
dw 22440
dw 22460
Structs
Player-- X Coordinate
Facing Direction
Holding?
¡ Purpose: Displays the introduction sequence on the screen
n Continues reloading files to create animation of dripping blood
nPlays Midi file during animation and also plays Wav files of voices, screaming, and bus wrecking
n Waits for Esc to be presseed to show Menu
n Calls
Loadpcx, Update_Screen, and necessary sound functions (i.e. MIDIplay)
nOffsets of Wav files and Midi files are also listed
nEscPressed is set whenever Player presses ESC
nscrseg - Segment of screen to load
nvbufseg
- Video Buffer Segment
¡ Purpose: Display the closing sequence to the game
n Returns the game either back to the initial menu
n Animation in the end of either dripping blood or words slide down screen
n Calls
necessary music functions and also loadpcx and Update_screen
n Offsets of all sound and video files are previously defined and used by this function
n EscPressed is variable determining if Esc has been pressed or not
n scrseg
and vbufseg are also used for displaying the pcx file
n Plays the necessary music and sound
n Returns to the beginning of the game
¡ Purpose: Load MIDI file into memory using DOS interrupt 21.
n The size of the file will be stored
in MIDIlength
n Segments
SoundPad and also SndSeg
n MIDIlength is adjusted as necessary
¡ Purpose: This will register an XMIDI file for play by MIDIPAK
n Length of MIDI file
n Stores the music files in memory
n Checks to make sure there were no errors
¡ Purpose: Plays the midi file registered with MIDIpak
¡ Purpose: Stop the currently playing MIDI file
¡ Purpose:
n
Reset the Mouse Drivers and Hardware
n Also Reads Status of Mouse
n Uses INT 33h
¡ Inputs: None
¡ Outputs:
n AX = FFFFh, OK Hardware Software installed
¡ Purpose:
n
Makes the mouse cursor visible on the screen
n Used after Mouse cursor is hidden
n Uses INT 33h
¡ Inputs: None
¡ Outputs:
¡ Purpose:
n
Makes the mouse cursor invisible on the screen
n
Used before writing to video memory to make sure graphics are displayed
correctly
when mouse first becomes visible
n Uses INT 33h
¡ Inputs: None
¡ Outputs:
¡ Purpose:
n
Returns Mouse position and status
n Counts by pixels
n Uses INT 33h
¡ Inputs: None
¡ Outputs:
n CX is pixel column position
nDX is pixel row position
¡ Purpose:
n
Positions the mouse on the screen
n Counts by pixels (0,0 is the upper left hand corner)
n Uses INT 33h with
¡ Inputs:
n DX is column position
n CX is the Row position
¡ Outputs:
¡ Purpose:
n
Sets the horizontal limit that the mouse can travel
n Counts by pixels (0,0 is the upper left hand corner)
n Uses INT 33h with
¡ Inputs:
n CX is Leftmost column position
n DX is the Rightmost column position
¡ Outputs:
¡ Purpose:
n
Sets the Vertical limit that the mouse can travel
n Counts by pixels (0,0 is the upper left hand corner)
n Uses INT 33h with
¡ Inputs:
n CX is Upper row position
n DX is the lower row position
¡ Outputs:
¡ Purpose:
n
Display a menu for instructions, playing the game and quiting
n Calls and Plays MIDI
n Accepts input from Mouse, Joystick, or Keyboard as necessary
n Change the color of the letters of the selection as each is selected by any input source
n Also dispalys instructions when activated and waits to redisplay menu
¡ Inputs:
n
EscPressed - If player pushes ESC, the game ends
n SpcPressed - If player pushes Space, then it activates the current selection
¡ Outputs:
n The necessary calls are made as selections are activated
¡ Purpose:
n
Calibrates Joystick for game play
n Returns values for user to see on the screen
n Sets right, left, up, down, button1 and button2
n If joystick option is not selected, then the Joystick flag is set to 0 and the function exits
n Uses int 15h
¡ Inputs:
n
Offsets of text messages to be displayed on the screen
n Keyboard input as to the joystic option
¡ Outputs:
n If the joystick is not to be used then the Joystick flag is set to 0
¡ Purpose:
n
Polls Joystick to check for direction and buttons
n Uses int 15h
n Sets right, left, up,and down directions as well as button1 and button2 flags
n If joystick option is not selected, then the function exits
n Uses int 15h
¡ Inputs:
n
JoystickFlg 0=No Joystick, 1=Use JoyStick
¡ Outputs:
n SpcPressed is set for button 1 and EscPressed is set for Button2
CopySeg
¡ Purpose:
n
Copies an entire segment
n Uses built-in complex instructions
¡ Inputs:
n
es segment to copy
n gs location of copy
¡ Outputs:
¡ Purpose:
nLoad
the necessary Wav file into WavPad
n Call initdsp, volume, dspwrite and play
¡ Inputs:
¡ Purpose:
nPlay
the Wav file that is in the WavPad
n Calls dspwrite
¡ Inputs:
¡ Purpose:
nInitialize
the Sound Card
n Writes to port 226h
¡ Inputs: None
¡ Outputs:
¡ Purpose:
nWrite
the sound information to the DSP memory
¡ Inputs: None
¡ Outputs:
Update_Screen
¡ Purpose:
n
Write the video buffer to the video memory
¡ Inputs:
n
Segment VBufSeg
¡ Outputs:
Loadpcx
¡ Purpose:
n
Load the pcx file into memory
n The palette is also loaded
¡ Inputs:
n
Offset of file
n Scratchseg and ScratchPad
¡ Outputs:
¡ Purpose: Controls game flow, waits until proper time to allow movement of players.
n Loads music, unloads music
n Loads intro screen
n Initializes graphics and grid
n Waits until different counts reach the proper count to move graphics on screen
n Allows people, trucks, buses, and main player to move at different speeds
n Keeps proper number of people and other graphics on screen at all times
n Calls appropriate exit screen
¡ Outputs: none
¡ Purpose: Install, de-install new keyboard interrupt handler
n Processes movements for main player
n Processes SPC, sets SpcPressed to allow main player to pick up people
n OldKeyV: for DeInstKey
n PkeyDir: Direction of main player
n EscPressed, SpcPressed
¡ Purpose: Install, de-install new timer interrupt handler
¡ Purpose: Moves and controls player according to read in instructions for direction and control of player.
¡ Purpose: To switch into different grid segments
¡ Purpose: to control the movements of trucks, and to draw them on the screen.
¡ Outputs: truck moved in appropriate direction along screen
¡ Purpose: to control the movements of buses, and to draw them on the screen.
¡ Outputs: Bus moved in appropriate direction along screen
n PeopleArray--contains info of person
n
persondropped--unitialized
n enddrop--grid coordinates of the end of the toss
Pick
RedrawArea
CheckTruckHit
BouncePlayer, BouncePerson
GetGrid
¡ Purpose: Loads the GridBuffer from the screenbuffer
SIDEWALK = 1
GRASS = 2
BARRIERS = 3
¡Owner: Michael Drzal
¡Purpose: Saves the current grid into a file
¡Inputs:
n DX = offset of ascii filename
¡Outputs:
n Gridfile
SaveGrid
¡Owner: Michael Drzal
¡Purpose: Loads a gridfile into gridbuffer
¡Inputs:
n DX = offset of ascii filename
¡Outputs:
n Initialized gridbuffer
InitGraphics
¡ Purpose: Loads and uncompresses all pcx files for graphics to put them in disk cache
¡ Purpose: Loads and uncompresses all grid files for grids to put them in disk cache
¡ Purpose: Loads initial values into arrays for vehicles and people
¡ Inputs:
MakeTruck
¡ Inputs:
¡ Inputs:
n X = x-coordinate
n Y = y-coordinate
n Dir = direction
that the parking police is facing
¡ Purpose: Bus a Person with Position (X,Y) and direction Dir and type Type
¡ Inputs:
¡ Purpose: Draw a Bus with Position (X,Y) and direction Dir
¡ Inputs:
nX
= x-coordinate
n Y = y-coordinate
n Dir = direction that
the bus is facing
¡ Outputs: