player is hit

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
databandit
Posts: 32
Joined: Tue Dec 21, 2004 11:36 am

player is hit

Post 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
sugarhigh
Posts: 14
Joined: Sat May 28, 2005 4:11 am

Post 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
}
ab illo cui multum datur multum requiritur
Post Reply