Ben Faulkner
- Variables
- diescreen db 'diescren.bmp',0
- ThrustXTable Real4 1.0
Real4 0.923879532511
Real4 0.707106781187
Real4 0.382683432365
Real4 0.0
Real4 -0.382683432365
Real4 -0.707106781187
Real4 -0.923879532511
Real4 -1.0
Real4 -0.923879532511
Real4 -0.707106781187
Real4 -0.382683432365
Real4 0.0
Real4 0.382683432365
Real4 0.707106781187
Real4 0.923879532511
- ThrustYTable Real4 0.0
Real4 -0.382683432365
Real4 -0.707106781187
Real4 -0.923879532511
Real4 -1.0
Real4 -0.923879532511
Real4 -0.707106781187
Real4 -0.382683432365
Real4 0.0
Real4 0.382683432365
Real4 0.707106781187
Real4 0.923879532511
Real4 1.0
Real4 0.923879532511
Real4 0.707106781187
Real4 0.382683432365
- tempFloat Real4 0.0
- tempWord dw ?
- XMin real4 160.0
- XMax real4 1119.0
- YMin real4 100.0
- YMax real4 699.0
- PlacePlayerXTable real4 213.0
real4 1067.0
real4 213.0
real4 1067.0
- PlacePlayerYTable real4 133.0
real4 667.0
real4 133.0
real4 667.0
- BULLETFIREDISTANCE EQU 22
- BulletXTable dw 24
dw 24
dw 24
dw 12
dw 0
dw -12
dw -24
dw -24
dw -24
dw -24
dw -24
dw -12
dw 0
dw 10
dw 24
dw 24
- BulletYTable dw 0
dw -10
dw -24
dw -24
dw -24
dw -24
dw -24
dw -12
dw 0
dw 12
dw 24
dw 24
dw 24
dw 24
dw 24
dw 12
- BulletSpeed db 5
db 6
db 6
- FireBulletFlag db 0
- MenuNum db 0
- MenuTable dw offset Menu0
dw offset Menu1
dw offset Menu2
dw offset Menu3
dw offset Menu4
- MoveXTable db 1
db 2
db 1
db 1
db 0
db -1
db -1
db -2
db -1
db -2
db -1
db -1
db 0
db 1
db 1
db 2
- MoveYTable db 0
db -1
db -1
db -2
db -1
db -2
db -1
db -1
db 0
db 1
db 1
db 2
db 1
db 2
db 1
db 1
- OBJSpeedToggle db 0
- OBJECTDISTANCE EQU 25
- BULLETDISTANCE EQU 25
- BULLETOBJECTDISTANCE EQU 15
- BulletMoveXTable db 2
db 2
db 1
db 1
db 0
db -1
db -1
db -2
db -2
db -2
db -1
db -1
db 0
db 1
db 1
db 2
- BulletMoveYTable db 0
db -1
db -1
db -2
db -2
db -2
db -1
db -1
db 0
db 1
db 1
db 2
db 2
db 2
db 1
db 1
Procedures
- calcThrustTurn
- Purpose: To increase or decrease the speed of player or rotate
player. Also calculates drag by decreasing the magnitude of MyXSpeed x MyYSpeed.
- Input: UpKey, MyOrientation, LeftKey, RightKey, LeftKeyCtr,
RightKeyCtr, MyXSpeed, MyYSpeed
- Output: MyXSpeed, MyYSpeed, MyThrust
- Notes: Procedure depends on status of UpKey or, if rotating player, on
LeftKey/RightKey. The rotation of player will continue at a rate of 3
increments of 22.5 degrees/second if the key is held down.
- calcPlayerPos
- Purpose: To calculate new and approximate positions
- Input: MyExactY, MyExactX, MyXSpeed, MyYSpeed, MyXPos, MyYPos
- Output: MyXPos, MyYPos, MyExactY, MyExactX, MyXSpeed, MyYSpeed,
- Notes: Takes into account rocks, edges, and other environment so that
the player can not move there.
- placePlayer
- Purpose: To reset resets MyLife, MyWeapon, MyExactX, MyExactY, MyXSpeed, MyYSpeed
for when a player starts the game or after dying
- Input: none
- Output: MyLife, MyWeapon, MyExactX, MyExactY, MyXSpeed, MyYSpeed
- calcBullets
- Purpose: To calculate the new position of all the bullets in the
BulletArray
- Input: MyBulletArray
- Output: MyBulletArray
- Notes: Kills bullet if bullet leaves playable region.
- fireBullet
- Purpose: To finds an available position in MyBulletArray for a new bullet
- Input: FireBulletFlag, MyBulletArray
- Output: MyBulletArray
- Notes: If no position is available, no bullet is fired
- showMenu
- Purpose: To display main menu
- Input: UpKey, DownKey, EnterKey, EscapeKey
- Output: Network;to indicate if network support is wanted.
- calcObjects
- Purpose: To calculate the new position of objects such as fish,
rocks, seahorses, etc on the game map
- Input: MyObjectArray
- Output: MyObjectArray
- Notes: Does not move players or bullets.
- calcBulletCollision
- Purpose: To check if bullet owned by player has it anything
- Input: MyBulletArray, MyObjectArray
- Output: MyBulletArray, MyObjectArray
- Notes: If it is determined that an object has been hit, replace the
object and delete the bullet from BulletArray
- calcPlayerCollision
- Purpose: To check to see if player is hit by fish or bullet
- Input: MyLife, MyObjectArray, MyBulletArray.
- Output: MyLife, MyObjectArray, MyBulletArray.
- Notes: If it is determined that a player is hit by a fish or bullet,
it removes the object from the array, sends an object update packet and
decreases MyLife if it is determined that the player is dead.
- Calls:
- placePlayer
- sendObjectUpdate
- killObject
- Purpose: To kills the object at MyObjectArray[di] by randomly relocating
to another place on the playing field.
- Input: di; object array offset to kill object, MyObjectArray
- Output: MyObjectArray
- calcSonar
- Purpose: To calculate sonar graphic
- Input: PlayerArray, MyPos, MyNum
- Output: ScreenBuff
- Notes: Procedure draws display to ScreenBuff