Welcome
Welcome to the official IME documentation. Here you will find a detailed view of all the classes and functions.
Short example
IME is state based, which means that the game flow is controlled by pushing and popping game states at appropriate times. Here is an example, demonstrating how to start the engine. This example will display a knight patrolling a grid kingdom to protect it from scavengers and trolls
You need to do four things to get started:
- Define a state/scene
- Create engine settings/configurations (Not necessary)
- Instantiate the engine and initialize it
- Push initial state and start the engine
#include <IME/IME.h>
public:
knight->setTag("destroyerOfMen");
knight->getSprite().setTexture("knight.png");
knight->getSprite().scale(0.20f, 0.20f);
knight->attachRigidBody(physicsBody);
auto gridMover = std::make_shared<ime::KeyboardGridMover>(
tilemap());
gridMover->setTarget(knight);
});
.getAnimator().startAnimation("startled");
});
}
};
int main()
{
PropertyContainer settings;
settings.addProperty({"WINDOW_TITLE", std::string("Demo")});
settings.addProperty({"WINDOW_WIDTH", 800});
settings.addProperty({"WINDOW_HEIGHT", 700});
settings.addProperty({"WINDOW_ICON", std::string("assets/bitmap/icon.png")});
settings.addProperty({"FULLSCREEN", false});
settings.addProperty({"FPS_LIMIT", 60});
settings.addProperty({"V_SYNC", true});
settings.addProperty({"FONTS_DIR", std::string("assets/fonts/")});
settings.addProperty({"IMAGES_DIR", std::string("assets/textures/")});
settings.addProperty({"TEXTURES_DIR", std::string("assets/textures/")});
settings.addProperty({"SOUND_EFFECTS_DIR", std::string("assets/soundEffects/")});
settings.addProperty({"MUSIC_DIR", std::string("assets/music/")});
engine.initialize();
engine.pushScene(std::make_shared<Demo>());
engine.run();
return EXIT_SUCCESS;
}