Menu Variables MenuExitflag db 0 numberOfPlayer db ? TypeOfMidi db 0 Instructions db 0 StartGame db 0 Game Variables mainExitFlag db 0 TileNum db ? menu db 'menu2.pcx', 0 ;filename of pcx file
Constants
TileLength db 16 TileWidth db 16 MaxDamage db 5 minDamage db 0 gunDamage db 1 GernadeDamage db 3 hMissileDamage db 3 PowerDamage db 5 minHealth db 0 maxHealth db 10 worldWidth db 1400 ;the total world width in pixels worldHeight db 1000 ;the total world height in pixels ownWorldWidth db 260 ;each players screen width ownWorldHeight db 200 ;each players screen height
GENERAL FUNCTIONS;******Game
Engine**********************
;Written by Jimmy Chen
SHOWPCX PROC NEAR
;displays the pcx file directly on the Screen-videoseg
;input- Dx, offset of the pcx file name
;output-none(variable wise)
;written by Jimmy Chen-copied 99% from lab manuel
MouseMove PROC NEAR
;purpose-checks which menu label was clicked on
;inputs-None
;outpust-MenuStatusFlag
;written by Jimmy Chen
pickMidi PROC NEAR
;written by Jimmy Chen
;Purpose play, stop the midi that you chose
;input-mouse clicks
;outPut-None
KbdInstall PROC NEAR
;written by Jimmy Chen
;input- None
;output-None
;Purpose-telling the interrupt to now call my own keyboard
handler rather than the default.
KbdUninstall PROC NEAR
;Purpose-reintall the old keyboardhandler
;input-None
;outPut-None
;Written by Jimmy Chen
KbdHandler PROC far
;purpose-taking control over keypress via scan codes
;Input-dirStatus, TabFlag, fireStatus, shiftWeapon
;Written by Jimmy Chen
ChangeMidi proc near
;Purpose- flip-flop between a set of midis
;input- MidiNumber
;outPut- Midis being played
;Written by Jimmy Chen
; ****InstTimer****
; Saves default interrrupt vector in OLDTimerV.
; Points the timer interrupt to MyTimerHandler.
; Configures timer chip to send a signal 72 times per second
;Written by Jimmy Chen with get help from Mike-TA
; ****deInstTimer*****
; Restores OldTimerV as the default timer routine.
; Reconfigures the timer chip to send a signal 18 times per
second.
;Inputs: OldTimerV
; Outputs: none
;Written by Jimmy Chen with great help from mike_TA
MyTimerHandler Proc far
;Written by Jimmy Chen with great help from mike-TA
;Purpose to take control of the timer myself
;inputs: None
;outPut; None
movePlayer proc near
;Purpose- update the position of the player
;input- dirStatus
;outPut- Player1.pos_x, Player.pos_y
;written by Jimmy Chen
moveProjectile Proc near
;purpose-calculate the new projectile's location if a shot was
fired
;input-player1.(bullet ptr gun).pos_x, player1.(bullet ptr
gun).pos_y, player1.(bullet ptr gun).angle
;outPut- new bullet positions
;Written by Jimmy Chen
moveProjectile2 Proc near
;Purpose-update the projectile location of player2
;input-player2.(bullet ptr gun).pos_x, player2.(bullet ptr
gun).pos_y, player2.(bullet ptr gun).angle
;outPut- new bullet positions
;Written by Jimmy Chen
moveProjectile3 Proc near
;Purpose-update the projectiles position of player3
;input-player3.(bullet ptr gun).pos_x, player3.(bullet ptr
gun).pos_y, player3.(bullet ptr gun).angle
;outPut- new bullet positions
;Written by Jimmy Chen
checkBulletOFB proc near
;purpose to see if the bullet is out of bound
;input- player1.(bullet ptr gun).pos_x, player1.(bullet ptr
gun).pos_y
;output- showWeapon
;Written by Jimmy Chen
CheckPlayerOFB proc near
;purpose check if the palyer is out of bound
;input- player1.pos_x, player1.pos_y, player1.angle
;output- keep current position if out of bound
;Written by Jimmy Chen
CheckPlayerCollision proc
near
;purpose- check players collison with other players and obstacles
;input- player1.pos_x, player1.pos_y, all other objects'
locations
;output- playerCollisionFlag 1 if player has a collison and 0
otherwise
;uses- worldMap
checkProjectileCollision proc near
;purpose-check if my projectile hit anything
;input- player1.(bullet ptr gun).pos_x, player1.(bullet ptr
gun).pos_y, and all other objects's location
;output- projectileHit= 1, 2, 4, 8, 16 corresponding the the
player in the array hitted
; 0, if no player was hit and 32 if the projectile hit an
obstacle other then players
stall proc near
;Purpose- it will stay in this loop until the right mouse click
is pressed
;input-None
;outPut-None
;Written by Jimmy Chen
IntPlayer proc near
;Purpose initilize all variables and players
;Input-None
;outPut-a whole ton
;written by Jimmy Chen
Random PROC NEAR
;purpose-generates a random number
inputs:None
OutPuts:rndm
checkOFB proc near
;Purpose- check to see if the location that you specify is OFB
;input- AX-pos BX-ypos
;Output- isOFB
;written by Jimmy Chen