Rush Counter Reset Timer Bar

Aerisetta

Active member
Hi

I remember seeing a game where there is a Bar that indicates when the combo will reset. Does anyone remember which game(s) have this feature?
 
Wasn't mine either - my game uses a counter for the announcer and maybe you can use it as a base to customize to your needs.
Take a look at updated.c there

C-like:
void processRushCount(){
    void vEnt = getplayerproperty(0, "entity");
    if(vEnt != NULL()){
        int lastRushCount = getentityvar(vEnt, "last_rush_count");
        int rushCount = getentityproperty(vEnt, "rush_count");
        
        if(lastRushCount != NULL() && rushCount < lastRushCount){ // Combo ended, play sound
            rushCountSound(lastRushCount);
        }
        setentityvar(vEnt, "last_rush_count", rushCount);
        
    }
    
}
 
@Aerisetta I was curious to see how this kind of feature would work and I coded an example as a test.

C:
void main()
{
    void self        = getlocalvar("self");
    int time        = getentityproperty(self, "rush_time");
    int rush        = openborvariant("elapsed_time");
    int xPos        = 0; //BAR X POSITION
    int yPos        = 100; //BAR Y POSITION
    int zPos        = 1001; //BAR Z LAYER
    int color        = rgbcolor(255,255,0); //BAR COLOR
    float xSize        = 50; //BAR WIDTH
    float ySize        = 5; //BAR HEIGHT
    float maxTime    = 1; //MAX RUSH TIME DEFINED IN THE LEVELS.TXT. CAUTION!! MUST BE THE SAME
    float countdown    = time-rush; maxTime = maxTime*200; if(countdown < 0){countdown = 0;} //COUNTDOWN FORMULA
    float bar        = (countdown*xSize)/(maxTime); //BAR SIZE FORMULA
    
    drawbox(xPos, yPos, bar, ySize, zPos, color);
}

 
Back
Top Bottom