Page 1 of 1

[b]HELP![/b] Classes for a biginner game

Posted: Thu Jan 13, 2005 8:03 pm
by Bos
i been working with Irrlicht for some time now and managed to get an FPS game going(load bsp map,skybox,crosshair,collision,added a 3ds gun)thats how far i am atm,then i realised that in order to make a proper game or demo i would need to make classes like a player classe to hold healt items ect. The only thing is i don't really know how to go about this :evil: . if someone can help me out, or even point me at some source code for another game that i could look at would be awsome.

Thanks in advance!

Posted: Thu Jan 13, 2005 10:29 pm
by WalterWzK
Well, health items for example?? you mean like the current percentage of healt the player has remaining?? I cant believe that, you must be talking about something bigger cuz there is nothing more simple than storing integers and other values

Hey now

Posted: Fri Jan 14, 2005 3:32 am
by Munku
Walter: Play nice.

Bos: Are you new to C++? I take it you are. I suggest looking in the external tutorials for a C++ Tutorial. You *need* to understand C++
and a lot of it's annoyances :)

Posted: Fri Jan 14, 2005 10:52 am
by WalterWzK
@Bos:

Sorry my english is not very well, but i did not ment it that way.

What I was trying to understand what he was up to, cuz when I read what he already could do I thought it could not be about storing values into variables.. Hes just too good for asking such a question. So I think hes problem is bigger than that and was trying to get hem explaining to me what he really ment.

Posted: Sat Jan 15, 2005 1:38 pm
by Bos
no offence taken :) . i have done quite alot of C++, i am somewhat familiar with it, and can read+understand code well. I think that I asked my queston badly, to put it better -so u have a class for ur player with the bits in like a health int, name, ect.but the thing is, how would u make use of that and draw the health in the HUD.i know how it would work if a monster attacks u, subtract its dmg from ur health.i dunno, i guess i need to look at some more source code, and examples, if i can find.

Posted: Sat Jan 15, 2005 1:56 pm
by WalterWzK
Well like you said, with collision or stuff like that you can retrieve a signal when the player has been hit. Afterwards you substract the health points from the stored health-variable and than with the GUI->Font you rewrite the current percentage of health left. This rewriting should be implemented in the loop so that the player sees his current healt realtime :P

Is that what you ment?

Posted: Sat Jan 15, 2005 3:37 pm
by Bos
well, yes, that is pretty much the answer to my question :D but i do admit, i need to do some more C++.

thnx!