Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
Game Scenes

Start off by declaring the header file and including all the objects you'll need for this scene.

#include <RuneEngine.h>
#include "player.h"
#include "floorTile.h"
class FirstLevel : public rune::GameScene
{
private:
//Add a player object
Player playerObject;
//Create the scene floor
FloorTile groundTile1;
FloorTile groundTile2;
rune::Camera sceneCamera;
};

After you have all of these objects added in the header, go ahead and instantiate the objects in the scene by creating a doInit(void) function.

public:
virtual void doInit(void) override;

Then in this function you can add objects to scene, set up cameras, change positions of objects, and anything else you could normally do with a rune::GameObject.

void FirstLevel::doInit(void)
{
//Change the color that the screen will be cleared with.
clearColor = rune::Color(49,77,121);
//Add player object
addObjectToScene(playerObject)
//Add the floor to the scene
addObjectToScene(groundTile1);
addObjectToScene(groundTile2);
//Change the position of each object independently.
m_groundTile1.transform.setPosition(rune::Vec3(0,0));
m_groundTile2.transform.setPosition(rune::Vec3(128, 0));
//Set up the camera
SceneCamera.setZoom(2.5);
SceneCamera.setCenter(rune::Vec2(m_player.transform.getPosition().x+180, m_player.transform.getPosition().y+30));
getGameInstance()->getWindow()->setCamera(sceneCamera);
}

And now you should have your first rune::GameScene up and running! All that's left to do is add it to your rune::GameApplication in your main function.

See how to create a new rune::GameApplication

rune::GameScene
This class is responsible for serving as a parent class for each instance of the game....
Definition: gameScene.h:29
rune::Vec3
1 x 3 vector to be used for math.
Definition: vec3.h:22
rune::Camera
This class is used to control the viewport of the scene.
Definition: camera.h:22
rune::Vec2
1 x 2 vector to be used for math.
Definition: vec2.h:20
rune::Color
A color object to be applied to drawable objects.
Definition: color.h:19