Hello ! I'm working on a First Person Shooter, and I want to add a hud (like stats, current weapon, ammo, radar, timer etc etc).
But I don't know how to manage . I placed a 2d weapon looking like counter strike on my screen, but I only know how to set pictures. I would like to be able to remove them, to move them etc...
My questions are :
1) How do you move/remove/resize images with Irrlicht ?
2) How do you create a timer ? ("00:57:96" format) which wou can start/stop, and how do you place it on your screen ?
3) How do you make a radar, showing a circular sector of the map, with green and red dots for the players ?
4) (if possible ^^') How to move other player with artificial intelligence ?
And if you know how to do other cool things for my hud, just tell me please ^^.
Thanx,
Aen
Need help for a hud
1) see sprite tutorial
2a) get access to Irrlicht timer, b) I leave to you to convert to string in the format you want, c) see the gui example (or pre-render number/letters sprite then use the sprite tutorial)
3) For the background: read the sprite tutorial, for the line, search for Draw2DLine, for the glowing after effect, either search for rotating billboard/sprite on the forum or apply the texture on a quad then rotate it, for the dots, either use sprite, a Draw2DLine, or an equivalent for points, for finding where to draw, it all depends how your system works. I'll take a guess and assume you want it to display enemies based on their x, z position and only if they are within a certain range in y? in which case, go through the list of all potential allies and enemies, make a point at coordinate
vector3df NPCPos = NPC.getAbsolutePosition();
vector3df PlayPos = Player.getAbsolutePosition();
If (NPCPos.y - PlayPos.y > -Blah && NPCPos.y - PlayPos.y < Blah)
{
DrawPointSomehow((NPCPos.x - PlayPos.x) * Modifier_of_size_on_your_map_for_x, (NPCPos.z - PlayPos.z) * Modifier_of_size_on_your_map_for_z);
}
4) Search for Artificial Intelligence everywhere. That in itself is a topic extremely hard if you're looking for anything good.
2a) get access to Irrlicht timer, b) I leave to you to convert to string in the format you want, c) see the gui example (or pre-render number/letters sprite then use the sprite tutorial)
3) For the background: read the sprite tutorial, for the line, search for Draw2DLine, for the glowing after effect, either search for rotating billboard/sprite on the forum or apply the texture on a quad then rotate it, for the dots, either use sprite, a Draw2DLine, or an equivalent for points, for finding where to draw, it all depends how your system works. I'll take a guess and assume you want it to display enemies based on their x, z position and only if they are within a certain range in y? in which case, go through the list of all potential allies and enemies, make a point at coordinate
vector3df NPCPos = NPC.getAbsolutePosition();
vector3df PlayPos = Player.getAbsolutePosition();
If (NPCPos.y - PlayPos.y > -Blah && NPCPos.y - PlayPos.y < Blah)
{
DrawPointSomehow((NPCPos.x - PlayPos.x) * Modifier_of_size_on_your_map_for_x, (NPCPos.z - PlayPos.z) * Modifier_of_size_on_your_map_for_z);
}
4) Search for Artificial Intelligence everywhere. That in itself is a topic extremely hard if you're looking for anything good.
This is a very intresting thred and I am also intreseted in this topic.
Programming Blog: http://www.uberwolf.com
I am interested in how the radar will turn out.
GO HERE NOW! please?
My friends website - http://www.ecoblues.net/joomla/
My website - http://www.harborcityschool.net/~pjewell
My friends website - http://www.ecoblues.net/joomla/
My website - http://www.harborcityschool.net/~pjewell
device->getTimer() will return you a pointer to the Irrlicht timer. It has methods for accessing the time as milliseconds since some arbitrary start time.
If you want to get the wall clock time, you should use one of the C library time functions. strftime() [or wcsftime()] can format the date/time as a string in pretty much any format you want. If you just want the time/date as data, you can use localtime().
Travis
If you want to get the wall clock time, you should use one of the C library time functions. strftime() [or wcsftime()] can format the date/time as a string in pretty much any format you want. If you just want the time/date as data, you can use localtime().
Travis