ECE291
Computer Engineering II
Spring '98
 
IT'S TIME FOR SOME REVENGE . . . .
Rampage 291
Rampage 291 is based on the original arcade game, Rampage, slightly modified to crave every ECE's natural born instinct, DESTROY EVERITT LAB.
That's right...you get to smash Everitt Lab into a smoking pile of rubble.
 
 
Team Members:
Jason Edla - game engine and design
Rami Moussa - "AI", player movement, Midi
Timothy Schmitt - Graphics, Intro/Concl., web page
Spencer Patrick - Sound

Description:

Rampage 291 is based on the original arcade game, Rampage. Rampage 291 will offer 1 or 2 player selection and the opportunity to crush Everitt Lab. Your choice of various "monsters" can move left and right along the street, up and down along the building, and deliver devastating blows. Little helicopters and planes will create enemy fire and destruction will create electrical and fire disasters, all making your job harder by draining your character's hit points. Points are scorced based on time, dealing damage, and items picked up along the way.

Obstacles:

Your critter has a finite life span, which will be represented by a life bar. Tanks will shoot at your critters and planes will do bomb runs over the area in attempts to kill the critters attacking Everitt Lab. There are also other damaging hazzards from Everitt Lab itself. If your life bar runs out, you're out of the game.

Movement Controls:

The arrow keys control the critter for player#1, with Right Alt for punch and Right Ctrl for jumping.

For player#2, the E,S,D and F keys control movement, with Space_bar for punch and N for jump.

Green Street will be in front of Everitt. Critters can move right or left on Green. If your critter is at the sides of Everitt and facing the edge, the up arrow will start it climbing the walls. If you're at the top of Everitt, you may use the appropriate horizontal arrow key to walk on the roof. Down arrow makes critters climb down. Jump is using to get your critter off of Everitt when it starts to collapse to avoid falling damage. When the punch key is used, critters punch in the direction they were moving last.

THE BACKGROUND

Background The background scenery will be a simple bitmapped image which will be placed onto the ScreenBuffer first, and buildings, characters, and bombs, will be placed over it. This will be done each time the screen is refreshed. The PCX file containing the background scenery will be decoded to the BackGround Segment, where it will remain unchanged.
Note: moving clouds have been added to the background. They will be added to the background segment after the background picture has been added, but at different locations each time the screen is updated, giving the illusion of moving.

THE BUILDING

Building Chart
**All other whitespace will be filled with 'O' for Open Space.

Building Array

The building will be implemented by an array, of varying size, in which each character of the array will represent a section of the building. These characters will correspond to various bitmap textures for different areas of the buildings outer surface, such as windows, doors, brick surfaces, etc. This array will change when certain areas of the building receive damage, and so the corresponding characters will change to represent "damaged" textures. These damaged textures will be altered versions of the regular building textures, edited to show the physical damage done by the players. Also, many parts of the building will have special items, such as bonus points or increases in health, or even harmful items, such as live electrical wires or poison. The building textures will change to show these special items only when that wall area has received sufficient damage. The building will be drawn according to the array and kept in the Building Segment where it will be copied to the ScreenBuffer after the BackGround Segment. The entire screen will actually be represented by the BuildingArray, with zeros to indicate "blocks" with no building segments. This will essentially divide up the screen into blocks, with some blocks being filled in with building segments, and most being skipped over. This setup ensures buildings of any length and width to be usable by the game, and drawn based simply on the BuildingArray.

Damaging the Building

As decribed in the previous paragraph, damage to the building will be shown by replacing the building textures with damaged replacement textures. The Damage array will have the same dimensions of the Building Array, however, each "block" will contain an integer indicating the strength of each part of the building. Each block of the Damage Array will hold the value indicating the strength of the corresponding block of the Building array. Each hit to a block will reduce the value of that block in the respective index of the damage array by one. Checkbuilding procedure will check the "health" of the building at each screenupdate. If a block has a damage value of zero, the Building array will be changed so that that particular index of the Building Array will now hold the "damaged" version of the same texture. The total damage of the building is found by summing the totals of the Damage array. If this level is below the predetermined constant level for that board, CheckBuilding will instruct the program to halt play and crash the building.

Crashing the Building

After the building has received enough damage to be considered destroyed, and thus the level completed, an animated sequence will ensue in which the building crumbles to the ground, and the sound of the building crashing is heard. The level of damage the building has undergone is kept by an internal variable, as is the total level of damage that the building can stand. When the building has reached its maximum level of damage, a procedure will be called to flip through a set of bitmapped pictures showing the building crumbling. The gameplay is paused at this point, as players will not be able to move and attacking people (planes, tanks) will cease to enter the screen. If a player is on the building when it crashes, the player recieves harm to its health level. The player putting the finishing blow on the building will receive bonus points.

THE PLAYERS

NOTE: Identical methods will be used for both players.
Up to two players will be able to choose between several characters in the menu screen. Each character will be represented by 10 bitmap sprites. Two will be used for walking in both each direction. Two will be used for climbing in each direction. Two will be used for punching. This will help in bringing an animated look to all the characters actions. The player can be moved left and right, jump, punch, and climb up and down. Each player will have a designated amount of health, indicated by a bar at the top of the screen, and a score, also at the top. A player loses health by touching hazards in the building, or being hit by the little shooters (planes and tanks). A players gains points by damaging the building, killing shooters, or outlasting the other player. When a player's health reaches zero, the player is dead, and an animated death sequence will be called by the program. The other player still continues, and recieves bonus points for outlasting his contemporary.
MovementProc will be responsible for controlling most of the players movement, and will call helper functions to accomplish jumping and climbing. MovementProc will adjust play_x and player_y which will be used by Draw_Char to draw the player at the new position. MovementProc will determine the new position by reading the keyboard variables.
Having the players harm each other is one of several options that will hopefully be implemented, but not guaranteed.

THE SHOOTERS

One of the most challenging aspects of designing the game will be implementing the shooters, also referred to as enemies or bombers. The shooters wil be tiny human tanks and bomber planes, continuously scurrying past the screen and shooting at the players. The tanks will attack from the ground, and the planes will attack from the sky. If a player is hit by a shooter, he will lose energy. The player, however, can punch the shooters for bonus points. The shooters will be implemented by using loops to have them move across the screen at regular intervalsm, and shoot from predetermined destinations. Even destroying not stop this process, as new shooters will be assumed to take their place. Having effective shooters will be the key to making Rampage 291 a challenging game.

Here are the segments used by the program:

VIDSeg-- has the actual Screen Segment
CldSeg--  Cloud Segment
ScrSeg -- Used by LoadPCX
BGSeg -- background texture
BLDSeg -- building texture
TextSeg -- holds the score and hit points (text)
SBSeg -- ScreenBuffer
FGSeg -- holds the sprites of the various characters and enemies
FGSeg2 -- buffer for additional sprites

Here are the general variables used by the program:

 
Cloud1spd       dw  0           ; variable to determine speed and location of cloud set 1
Cloud2spd       dw  0           ; variable to determine speed and location of cloud set 2
 
_BackGrnd      dw BGSeg   ; Value of Background Segment
MapLoc           dw 0           ; Offset to current map array
WorldSize        dw 0           ; Size of the current map
ShiftedBit         db ?             ; used to test in keypressed routines
DamageNum    dw 0            ; block number that has been damaged by player
Building_Damage    dw 0      ; total damage of the building, certain values cause the building to show more damage, and also to crash
BlockNum        dw 0           ; used to keep track of block currently being checked
BonusCounter   dw 0           ; keeps bonus pictures on the screen for a certain amount of time
BonusBlockx2   dw 0          ; block in which bonus is to be drawn
BonusPicx2       dw 0          ; bonus picture number to draw
player1_x    dw 0
player1_y    dw 0
player2_x    dw 0
player2_y    dw 0
hand1_x      dw 0
hand1_y      dw 0
hand2_x      dw 0
hand2_y      dw 0
body_block1  dw 0
body_block2  dw 0
hand_block1  dw 0
hand_block2  dw 0
JUMP_1       DW 0
JUMP_2       DW 0
FALL_1       DW 0
FALL_2       DW 0
JUMPE_1      DW 0
JUMPE_2      DW 0
DIREC_1      DB 0
DIREC_2      DB 0
PUNCHING1     DW 0
PUNCHING2     DW 0
PUNCH1        DW 0
PUNCH2        DW 0
PUSHED1       DW 0
PUSHED2       DW 0
EXPLODE_1     DW 0
EXPLODE_2     DW 0
EXPLODE_H     DW 0
EXP_HELI      DW 0
SCORE1  DW 0
SCORE2  DW 0
HEALTH1 dw      50
HEALTH2 dw      50
 

Keyboard Interrupt Variables

ESC_KEY    db 0 ; Set to 1 when time to exit  (ESC)
ENTER_KEY  db 0
     ;PLAYER1
RIGHT_ARROW   db 0 ; Right Arrow (1 = Button is down, 0 = Button is up)
LEFT_ARROW    db 0 ; Left Arrow
UP_ARROW      db 0 ; Up Arrow
DOWN_ARROW    db 0 ; Down Arrow
CNTRL_KEY     db 0 ; RIGHT Ctrl JUMP
ALT_KEY       dw 0 ; RIGHT Alt  PUNCH
OLD_ALT_KEY   dw 0
     ;PLAYER2
F_KEY           db 0 ; Right Arrow (1 = Button is down, 0 = Button is up)
S_KEY           db 0 ; Left Arrow
E_KEY           db 0 ; Up Arrow
D_KEY           db 0 ; Down Arrow
N_KEY           db 0 ; N KEY JUMP
B_KEY       dw 0 ; B KEY  PUNCH
OLD_B_KEY   dw 0
Character dw 0,50,100,150,200,250

          dw 16000,16050,16100,16150,16200,16250
          dw 32000,32032,32064,32096,32132,32165,32231
          dw 38400,38417,38433,38449,38465,38481,38497,38513,38529,38545,38561,38577
          dw 44800,44811,44823,44834,44845,44856,44867,44878,44889,44900,44911,44922
 

Look Up Tables and Arrays

 
;offset for the pixel locations of the 16x20 blocks
BuildLoc        dw      0,16,32,48,64,80,96,112,128,144,160,176,192,208,224,240,256,272,288,304
                      dw     6400,6416,6432,6448,6464,6480,6496,6512,6528,6544,6560,6576,6592,6608,6624,6640,
 ,6672,6688,6704
                      dw     12800,12816,12832,12848,12864,12880,12896,12912,12928,12944,12960,12976,
  12992,13008,13024,13040,13056,13072,13088,13104
                      dw     19200,19216,19232,19248,19264,19280,19296,19312,19328,19344,19360,
 19376,19392,19408,19424,19440,19456,19472,19488,19504
                     dw     25600,25616,25632,25648,25664,25680,25696,25712,25728,25744,25760,
25776,25792,25808,25824,25840,25856,25872,25888,25904
                    dw     32000,32016,32032,32048,32064,32080,32096,32112,32128,32144,32160,
32176,32192,32208,32224,32240,32256,32272,32288,32304
                   dw     38400,38416,38432,38448,38464,38480,38496,38512,38528,38544,38560,
38576,38592,38608,38624,38640,38656,38672,38688,38704
                  dw     44800,44816,44832,44846,44864,44880,44896,44912,44928,44944,44960,
44976,44992,45008,45024,45040,45056,45072,45088,45104
                 dw      51200,51216,51232,51248,51264,51280,51296,51312,51328,51344,51360,
51376,51392,51404,51424,51440,51456,51472,51488,51504
                 dw     57600,57616,57632,57648,57664,57680,57696,57712,57728,57744,57760,
57776,57792,57808,57824,57840,57856,57872,57888,57904
 
    ;damage of the particular blocks
Damage   dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,40,40,40,40,40,40,40,40,40,40,200,200,200,200,200
         dw 200,200,200,200,200,40,40,40,40,40,40,40,40,40,40,200,200,200,200,200
         dw 200,200,200,200,200,40,40,40,40,40,40,40,40,40,40,200,200,200,200,200
         dw 200,200,200,200,200,40,40,40,40,40,40,40,40,40,40,200,200,200,200,200
         dw 200,200,200,200,200,40,40,40,40,40,40,40,40,40,40,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
 
;checks to see whether the block has been damaged before and if so, what level damage
DamageFinder   dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
               dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 
 ;original building array
Original dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
         dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
         dw 0,0,0,0,0,0B4h,0,0,0,0,0,0,0,0,0B5h,0,0,0,0,0
         dw 0,0,0,0,0,1,2,2,2,2,2,2,2,2,3,0,0,0,0,0
         dw 0,0,0,0,0,6,5,5,5,5,5,5,5,5,7,0,0,0,0,0
         dw 0,0,0,0,0,6,8,8,8,011h,012h,8,8,8,7,0,0,0,0,0
         dw 0,0,0,0,0,6,9,9,9,0Fh,010h,9,9,9,7,0,0,0,0,0
         dw 0,0,0,0,0,0Bh,0Ah,0Ah,0Ah,0Dh,0Eh,0Ah,0Ah,0Ah,0Ch,0,0,0,0,0
         dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
         dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 
         ;new building array
Building dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,0,1,2,3,4,5,6,7,8,9,200,200,200,200,200
         dw 200,200,200,200,200,20,21,22,23,24,25,26,27,28,29,200,200,200,200,200
         dw 200,200,200,200,200,40,41,42,43,44,45,46,47,48,49,200,200,200,200,200
         dw 200,200,200,200,200,60,61,62,63,64,65,66,67,68,69,200,200,200,200,200
         dw 200,200,200,200,200,80,81,82,83,84,85,86,87,88,89,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
 
;location of bonus prizes
Bonus    dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,001,200,200,200,200,200,200,200,200,002,200,200,200,200,200
         dw 200,200,200,200,200,01,200,200,200,200,200,200,200,200,2,200,200,200,200,200
         dw 200,200,200,200,200,01,200,200,200,200,200,200,200,200,2,200,200,200,200,200
         dw 200,200,200,200,200,00,200,200,200,200,200,200,200,200,2,200,200,200,200,200
         dw 200,200,200,200,200,00,200,200,200,200,200,200,200,200,2,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
         dw 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200
 
 

BonusPicArray   dw  320*(199-20), 320*(199-20)+16,320*(199-20)+32,320*(199-20)+48,320*(199-20)+64
                 ;     1=food      , 2=prize,       , 3=poison

 

Game Procedures:

SetupUpGameData

Inst_Key

My_Inst_Key

Deinstall_Key

Update_Stats

ShowScreenBuffer

Load_Cloud

Draw_Cloud

Draw_Char

  • Purpose: Draw a character at a particular X and Y position
  • Inputs:  player1_x, player1_y
  • Outputs: The character(s) is drawn to the ForeGround Buffer with the correct position
  • Draw_Char2
  • Purpose: Draw a character at a particular X and Y position
  • Inputs:  player1_x, player1_y
  • Outputs: The character(s) is drawn to the ForeGround Buffer with the correct position
  • Draw_Shooter

    Draw_Fire

    DrawBackground

    DrawBuilding

    DrawStats

    Draw_Intro

    DrawConcl

    Purpose: To handle the conclusion of the program
    Inputs: All segments
    Outputs: displays a closing sequence
    Calls: Delay

    LoadPCX

    ShowScreenBuffer

    MovementProc

    WorldValue

    Move_Enemy

    Player_Jump

    CheckBuilding

    CheckDamage

    DrawNaked

    Destroy Building

    Draw_Smoke

    LoadMidi

    RegisterXMIDI

    PlaySequence

    StopMidi

    PlaySound


    Last Modified On: Fri May 1 3:00:10 CDT 1998