//////////////////////////////////////////////////////////////////////
// score panels

//add player_panels() at end main function in main script
//need bmp 132x76 for panel background
//need font msgfont2.bmp, msgfont recolored green
// for 800x600 video mode 7

bmap scores_back = <player_panels.bmp>;

string scores_str = "Ammo
Health
Armor
Score";

var show_score = 0;

// FONT standard_font = <panfont.pcx>,8,10; already defined
FONT scores_font,<msgfont2.bmp>,12,16;
DEFINE score_font,scores_font;

DEFINE PLAYERPANEL01,scores_background;
DEFINE PLAYERPANEL02,scores_txt;
DEFINE PLAYERPANEL03,scores_digits;

PANEL scores_background
{
POS_X 30; POS_Y 512;
layer 2;
bmap = scores_back;
FLAGS REFRESH;
}

text scores_txt
{
pos_x 36; pos_y 516;
font = score_font;
string = scores_str;
layer 3;
}

PANEL scores_digits
{
POS_X 120; POS_Y 516;
layer 4;
DIGITS 0,0,3,score_font,1,show_ammo;
DIGITS 0,16,3,score_font,1,show_health;
DIGITS 0,32,3,score_font,1,show_armor;
DIGITS 0,48,3,score_font,1,show_score;
FLAGS TRANSPARENT,REFRESH;
}

function player_panels()
{
PLAYERPANEL01.VISIBLE = ON;
PLAYERPANEL02.VISIBLE = ON;
PLAYERPANEL03.VISIBLE = ON;
while(1)
{ // forever
if(ammo_number == 0) { show_ammo = 0; }
if(ammo_number == 1) { show_ammo = ammo1; }
if(ammo_number == 2) { show_ammo = ammo2; }
if(ammo_number == 3) { show_ammo = ammo3; }
if(ammo_number == 4) { show_ammo = ammo4; }
if(ammo_number == 5) { show_ammo = ammo5; }
if(ammo_number == 6) { show_ammo = ammo6; }
if(ammo_number == 7) { show_ammo = ammo7; }
if(player != NULL)
{
show_health = player._HEALTH;
show_armor = player._ARMOR;
}
wait(1);
}
}

//////////////////////////////////////////////////////////////////////
// score_points

// give enemy the action enemy001

var score_points = 0;

ACTION enemy001
{

score_points = 50;

MY._FORCE = 2;
MY._FIREMODE = DAMAGE_SHOOT+FIRE_PARTICLE+HIT_FLASH+0.05;
MY._HITMODE = HIT_GIB;//HIT_EXPLO;
MY._WALKSOUND = _SOUND_ROBOT;
anim_init();
drop_shadow(); // attach shadow to robot
actor_fight();
}

function state_die()
{
//code for score
show_score += score_points;

IFDEF WAR_CHAT_ON;
msg.STRING = war_dead_str;
show_message();
ENDIF;
MY._MOVEMODE = 0; // don't move anymore
MY._STATE = _STATE_DIE;
MY.ENABLE_SCAN = OFF; // get deaf and blind
MY.ENABLE_SHOOT = OFF;
MY.EVENT = NULL; // and don't react anymore

// check if we have a marker...
if(MY.ENTITY1 != 0)
{
// if so, remove it.
remove(MY.ENTITY1);
}

// check for *ADVANCED ANIMATION* (frame names and entity tick/dist values)
if(int(MY._WALKFRAMES) < 0)
{
// reset entity's animation time to zero
MY._ANIMDIST = 0;

while(MY._ANIMDIST < 100)
{
// if you have more than one attacking animation, here's where you would test for it...
// calculate a percentage out of the animation time
MY._ANIMDIST += 100*(TIME / (INT(((-MY._ADVANIM_TICK)&MASK_ANIM_ATTACK_TICKS)>>9))); // (x>>10) * 2
// set the frame from the percentage
ent_frame(anim_death_str,MY._ANIMDIST);
wait(1);
}
}
else
{
// decide whether it's a frame number (old) or frame name (new) animation
if(frc(MY._WALKFRAMES) > 0)// OLD STYLE ATTACK ANIMATION
{
MY.FRAME = 1 + MY._WALKFRAMES + MY._RUNFRAMES + MY._ATTACKFRAMES + 1;
MY.NEXT_FRAME = 0; // inbetween to the real next frame
while(MY.FRAME <= (1 + MY._WALKFRAMES + MY._RUNFRAMES + MY._ATTACKFRAMES + MY._DIEFRAMES))
{
wait(1);
MY.FRAME += 0.7 * TIME;
}
}// END OLD STYLE Death ANIMATION
else // new animation format (frc(MY._WALKFRAMES) == 0)
{
// reset entity's animation time to zero
MY._ANIMDIST = 0;

while(MY._ANIMDIST < 100)
{
wait(1);
// calculate a percentage out of the animation time
MY._ANIMDIST += 5.0 * TIME; // death in ~1.25 seconds
// set the frame from the percentage
// -old- SET_FRAME ME,anim_death_str,MY._ANIMDIST;
ent_frame(anim_death_str,MY._ANIMDIST);
}
}// END NEW STYLE ATTACK ANIMATION
} // END NOT ADVANCED


// If entity explodes after death
if((ME != player) && ((MY._HITMODE & MODE_HIT) == HIT_EXPLO))//(MY._HITMODE & HIT_EXPLO))
{

morph(ACTOR_EXPLO,ME);
MY._DIEFRAMES = ACTOR_EXPLO_FRAMES;
actor_explode(); // ends with the removal of this entity
return;
}

// If entity 'gibs' after death
if((ME != player) && ((MY._HITMODE & MODE_HIT) == HIT_GIB))//(MY._HITMODE & HIT_GIB))
{
_gib(25); // use new "gib" function
actor_explode(); // ends with the removal of this entity
return;
}
MY.PASSABLE = ON; // body remains
}


Francois 'Fang' Godbout Quebec, Canada P.S. I'm a fench canadian using GameStudio v5.203