Page 1 of 1

player is hit

Posted: Sat Jun 25, 2005 1:01 am
by databandit
hi,
i am developing an FPS... but i don't know how to flash a red bitmap when the player is hit.... for example... if the enemy shoots the player... a red bitmap will flash for 50ms.... how do i do that??

thanks...
zubair

Posted: Sun Jun 26, 2005 4:59 am
by sugarhigh
Well the way I would do it is by adding the command to display the red bitmap withing the loop of the player being hit. I hope that makes sense but if not here's a basic rundown of what I mean...

Code: Select all

if (playHit == 1)
{
     // Subtract helath and whatever else
     health - 10;
     
     // Flash red
driver->draw2DImage(images,position2d<s32>(0,0),rect<s32>(0,0,342,224),0,SColor(255,255,255,255),true);
     // Change above to fit your settings
}