;Written by Peter Lai
drawTile PROC NEAR
;Input: al: tile index
; DI: Screen location(top-left corner) positon where tile is
; print on the screen
; flag: which portion of the tile do you want to draw
; flag=0 == UpperLeft, flag=1 == LowerLeft, flag=2 == UpperRight
; flag=3 == LowerRight
; rowpix: yposition in the tile (from a point in the tile)
; colpix: xposition in the tile (from a point in the tile)
;colpix
; --------------------------------------------
; r| | |
; o| | |
; w| | |
; p| | |
; i| 0 | 2 |
; x| | |
; |--------------------*----------------------|
; | | |
; | | |
; | 1 | 3 |
; | | |
; | | |
; | | |
; --------------------------------------------
;
;Output: Writes directly to BufferSeg
;Purpose: Writes a partial of a tile to BufferSeg given the tile and screen
; position
;Written by Peter Lai
DrawScreen proc near
;Input: player1.pos_x, player1.pos_y
;Output: Draws to BufferSeg the 240x176 screen(what the player sees)
;Purpose: Given the player's x and y position, DrawScreen draws the correct
; background in the player's field of vision by calculating what map
tile the player is on and drawing the tiles around that position
;Written by Peter Lai
playerpic dw 5 ;starting tile
DrawPlayerAngle proc near
;Inputs: player1.angle, player(num), playerpic (tile # of player)
;Outputs: newplayerposition drawn on screen
;player1.angles==0,1,2,3,4,5,6,7,8,9,10,11 (clockwise)
;Purpose: Always draws your player in the middle of the screen
; Draws the position you are facing
;Written by Peter Lai
DrawtoVid PROC NEAR
;Input: None
;Output: Writes directly to screen from BufferSeg
;Purpose: Write the entire BufferSeg to screen
tilenumber dw 0
theangle dw 0
DrawObject proc near
;Inputs: xother(x position of the object), yother(y position of the object),
; myplayer1.pos_x, myplayer1.pos_y
; tilenumber(tile of the object), theangle(if it is a player to be drawn
; need player's angle position, playerornot(flag)
;Outputs: draws the object or player specified to BufferSeg given that object's
; x-y position on the map
;Purpose: Calculates the relative position of the object or player to your player's
; position. If the object or player is within your view of your screen
; DrawObject draws that object or player on your screen. This routine
; does many checks to see if the object or player is partially on your screen
; or not so as to draw that partial object on your screen
xthis dw ?
ythis dw ?
xmini dw 15
ymini dw 13
Playernum dw 0
oldposition dw 241
oldposition2 dw 241
;written by Peter Lai
DrawMiniMap proc near
;Inputs: xthis(the x position of the player)
; ythis(the y position of the player)
; PlayerNum(tells me which colored dot to draw)
; PlayerNum=1, which is your player, then
; draw red dot
; PlayerNum=2, which is your opponent, then
; draw blue dot
;Outputs: Draws a blue or red dot on the MiniBackground
; world map givent the PlayerNum
;Purpose: The dots represent your position and your
; opponents position relative to the world map
;written by Peter Lai
DrawMiniBackground proc near
;Input: None
;Output: Draws orange background of the minimap, draws
; the titles 'Player 1' and 'Player 2' below the minimap
;Purpose: Draws these background only once b/c they don't change
; this saves cpu time b/c we are not constantly drawing
; these things. This routine is called only once
;written by Peter Lai
StoreTiles proc near
;Input: None
;Output: Stores the offesets of the tiles in TileSeg to the
; Tile array so that the tiles are indexed easily using the
; the array
;Purpose: The tile array will be initialized to the offsets of the
; tiles in TileSeg
barpix dw 4
healthstatus dw 1 ;varies from 0 to 10
startdi1 dw 29042
startdi2 dw 48242
;written by Peter Lai
DrawHealthBars proc near
;Input: PlayerNum, healthstatus
;Ouput: Draws the healthbar given which the PlayerNum
; Draws the length of the bar given healthstatus
;Purpose: Vary the health status bar
;written by Peter Lai
StoreWorldMap proc near
;Input: None
;Output: Stores to Map array the tile numbers of the terrain
; we want set to the background
;Purpose: staticly store the tiles to Map
; Now given a specific map position, we know the tile
; at that position
;written by Peter Lai
DrawWeaponsBox proc near
;Input: typeofweapon (=0,bullet =1,missile)
;Output: Draw that weapon the player has selected
; on the bottom of your screen
;Purpose: You can tell which weapon you've selected