I've just taken up using the Irrlicht engine to create my idea of a game, and there are some things i can't quiet figure by myself.
Firstly, i'm not entirely sure on how to do the main menu thing. I can create the main game loop fine, and generally get it running, but i'm not sure how i would impliment a menu, my thoughts were creating a void function that holds the game loop and one that holds the menu, then using a bool to switch between them, would this type of thing work?
Secondly, i am using the inbuilt Irrlicht FPS Camera, and it works fine, but i'm having a few issues with jumping, when the jump key is held, or pressed in rapid succession the character just flys up continuosly. Before for a simple test i was using an if-statement in the loop that checked if the player was a certain height above the map's floor, it would set the jump power to 0, hence making them fall. That worked fine until i decided to use a map that had hiegher points in it, eg stars, ramps, multiple levels.
I was thinking that i should use some sort of tempoary vector that stores the players location pre-jump, and then a check if they are higher than a particular offset of that variable, but i'm not sure how i would go by doing that in a loop.
And lastly, I have been attempting to create a melee weapon for my character, and i wan't to check the distance between the character and the target, but no matter what i try to use it either never works, or i get compiler errors. What would be the appropriate way to check the distance between the player and it's aim target?
Thanks in advance for any help!
Some general questions from an absolute Irr-noob
I haven't quite gotten around to this in IrrLicht but in Xna we would define GameStates and in the update and draw functions (update is the begining of your loop and draw is the end) we would check for the correct game state. Im not quite sure how to remove something from being draw yet though. I'll look into it and get back to you if no one else does
Re: Some general questions from an absolute Irr-noob
yes, this should work, it's like a very basic state-machine though...koaandl wrote:Firstly, i'm not entirely sure on how to do the main menu thing. I can create the main game loop fine, and generally get it running, but i'm not sure how i would impliment a menu, my thoughts were creating a void function that holds the game loop and one that holds the menu, then using a bool to switch between them, would this type of thing work?
I would check if the player is on the ground or not...koaandl wrote:Secondly, i am using the inbuilt Irrlicht FPS Camera, and it works fine, but i'm having a few issues with jumping, when the jump key is held, or pressed in rapid succession the character just flys up continuosly. Before for a simple test i was using an if-statement in the loop that checked if the player was a certain height above the map's floor, it would set the jump power to 0, hence making them fall. That worked fine until i decided to use a map that had hiegher points in it, eg stars, ramps, multiple levels.
I was thinking that i should use some sort of tempoary vector that stores the players location pre-jump, and then a check if they are higher than a particular offset of that variable, but i'm not sure how i would go by doing that in a loop.
this can be done by casting a ray to the ground and check if it collides with the ground so you know the distance to the ground, this way you can determine if he is on the ground or in the air...
you can easily check the distance between two vectors (player position <-> enemy position) with vec1.getDistanceFrom(vec2)...koaandl wrote:And lastly, I have been attempting to create a melee weapon for my character, and i wan't to check the distance between the character and the target, but no matter what i try to use it either never works, or i get compiler errors. What would be the appropriate way to check the distance between the player and it's aim target?
I hope this helps...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java