One problem.
Right now this is what part of my code looks like
Code: Select all
health->setText(varhealth.c_str())
How would I do this?
Code: Select all
health->setText(varhealth.c_str())
Code: Select all
health->setText("Health: " + varhealth.c_str())
Code: Select all
int inthealth;
inthealth=100;
stringw varhealth = L"Health:";
varhealth += inthealth;
health->setText(varhealth.c_str());
I don't think Irr's gravity is fancy enough to start you slow. I think you just move a set number of units based on time.LemonMan wrote:That would make it so that when you jump you start slow and end fast?
Usualy when you jump you start fast and end slow.
I also don't understand the event handler...
Main is always ran first. Functions can't call themselves. When you write a function before main the program still starts on main. Irrlicht calls the event receiver itself during the device->run() procedure.LemonMan wrote:Everything...
I mean, something to do with the fact that is a function that comes before the main one and it is referencing nodes and stuff that have not yet been made. Did that make any sense?
Code: Select all
IAnimatedMeshSceneNode* uzi = 0;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (uzi != 0 && event.EventType == EET_KEY_INPUT_EVENT&&event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_SPACE:
{
//shoot
}
return true;
}
} return false;
}
};
Code: Select all
IAnimatedMeshSceneNode* uzi = 0;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (uzi != 0 && event.EventType == EET_KEY_INPUT_EVENT&&event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_SPACE:
{
//shoot
}
return true;
}
} return false;
// Add code here!!!!!!!!!
}
};
Code: Select all
if (event.EventType == EET_MOUSE_INPUT_EVENT)
{
// switch
// case
//stuff
// goes here
}