rendered paste body#include "scene/scene.cpp"
#include "network/network.cpp"
#include "physics/physics.cpp"
#include "thiscodesocks"
int main() {
ISceneManager *mgr = new ISceneManager(); // Init scene manager
IPhysicsManager *phys = new IPhysicsManager(); // Init physics manager
//CConnection *con = new CConnection("127.0.0.1",1234); // Init network manager
//con->openConnection();
ISceneNode *node = new ISceneNode("player.bmp",50,50); // Add a scenenode
mgr->addNodeToScene(node); // add it to scene
node->setPhysicsType(T_PLAYER); // we're a player
phys->addNodeToPhysics(node); // add it to physics
//con->sendSceneNode(node);
ISceneNode *platform = new ISceneNode("player.bmp",50,70); // Add a scenenode
platform->setPhysicsType(T_PLATFORM); // we're a platform
mgr->addNodeToScene(platform); // add it to scene
phys->addNodeToPhysics(platform); // add it to physics
//con->sendSceneNode(node);
mgr->setWindowCaption("Hey, world."); // set caption
while(true) {
phys->updateAll(); // update physics
mgr->renderAll(); // update scene
// Keypress events move us
if(mgr->keyPressed(K_UP)) {
position2d pos = node->getPos();
pos.y-=5;
node->setPos(pos);
}
if(mgr->keyPressed(K_DOWN)) {
position2d pos = node->getPos();
pos.y+=5;
node->setPos(pos);
}
if(mgr->keyPressed(K_RIGHT)) {
position2d pos = node->getPos();
pos.x+=5;
node->setPos(pos);
}
if(mgr->keyPressed(K_LEFT)) {
position2d pos = node->getPos();
pos.x-=5;
node->setPos(pos);
}
}
}