Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Scene {
- World* world
- Player* player
- Enemy* boss
- Camera* camera
- }
- State* gameState = new State();
- gameState->addScene(scene);
- State::update(double delta) {
- scene->update(delta);
- }
- State::update(double delta) {
- physicsSystem->applyPhysics(scene);
- }
- State::render() {
- renderSystem->render(scene);
- }
- RenderSystem::renderScene(Scene* scene) {
- Camera* camera = scene->camera;
- lookAt(camera); // Set up the appropriate viewing matrices based on
- // the camera location and direction
- renderHeightmap(scene->getWorld()->getHeightMap()); // Just as an example, you might
- // use a height map as your world
- // representation.
- renderModel(scene->getPlayer()->getType()); // getType() will return, for example "orc"
- // or "human"
- renderModel(scene->getBoss()->getType());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement