How to Compile a Linux Game? Where can I find a tutorial for that?
And my second:
Here is my Code, but I'm still searching for the error. The Compiler says:"
1 unaufgeloester externer Verweis in" something "_16@" or something. Here is my code...It should be an Linux Game.
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
int g_puneshed;
int g_score;
int g_end;
ISceneNode* g_scnode = 0;
int ahamster[9];
int arabit[9];
class KEYS_INPUT : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (g_scnode != 0 && event.EventType == EET_KEY_INPUT_EVENT&& !event.KeyInput.PressedDown)
{
g_end = 0;
switch(event.KeyInput.Key )
{
case KEY_NUMPAD1 :
{
g_puneshed = 1;
}
case KEY_NUMPAD2 :
{
g_puneshed = 2;
}
case KEY_NUMPAD3 :
{
g_puneshed = 3;
}
case KEY_NUMPAD4 :
{
g_puneshed = 4;
}
case KEY_NUMPAD5 :
{
g_puneshed = 5;
}
case KEY_NUMPAD6 :
{
g_puneshed = 6;
}
case KEY_NUMPAD7 :
{
g_puneshed = 7;
}
case KEY_NUMPAD8 :
{
g_puneshed = 8;
}
case KEY_NUMPAD9 :
{
g_puneshed = 9;
}
case KEY_ESCAPE :
{
g_end = 1;
}
return true;
}
}
}
};
void test_puneshed()
{
if(ahamster[g_puneshed] == 1)
{
g_score = g_score + 10;
}
if(arabit[g_puneshed] == 1)
{
g_score = g_score - 10;
}
}
void main()
{
KEYS_INPUT KEYS;
IrrlichtDevice *device = createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16, false, false, &KEYS);
//Text in der Titelleiste des Fensters erzeugen... dabei steht das L für die "wide character strings"
device->setWindowCaption(L"Wacko");
//Pointer auf den Video Treiber, den ScenenManager und der GUI setzten.
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
//Text anzeigen
guienv->addStaticText(L"This is Wacko for Linux",
rect<int>(10,10,200,30), true);
IAnimatedMesh* hamster = smgr->getMesh("models/hamster.ms3d");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( hamster );
IAnimatedMesh* rabit = smgr->getMesh("models/rabit.ms3d");
node = smgr->addAnimatedMeshSceneNode( rabit );
if(node)
{
node->setMaterialTexture(0, driver->getTexture("textures/firsttree.bmp"));
}
while(device->run())
{
if(g_end == 1)
{
break;
}
smgr->addCameraSceneNode(0, vector3df(0, 10, -40), vector3df(0,0,0));
test_puneshed();
driver->beginScene(true, true, SColor(0,100,100,100));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
}
How I become a random Number between 1 and 9?
That's all,
thanks a lot!
PS: Sorry for bad english!
Fliege