#include <iostream>
#include <string>
+#include <vector>
#include <boost/shared_ptr.hpp>
#include <Moof/Camera.hh>
-#include <Moof/Dispatcher.hh>
#include <Moof/Interpolator.hh>
#include <Moof/Layer.hh>
#include <Moof/Math.hh>
-#include <Moof/Scene.hh>
+#include <Moof/Script.hh>
#include <Moof/Sound.hh>
#include "Character.hh"
-#include "Hud.hh"
+#include "Heroine.hh"
+#include "Scene.hh"
class GameLayer;
}
void pushed(Mf::Engine& engine);
- void update(Mf::Scalar t, Mf::Scalar dt);
- void draw(Mf::Scalar alpha) const;
- bool handleEvent(const Mf::Event& event);
-private:
+ void update(Mf::Engine& engine, Mf::Scalar t, Mf::Scalar dt);
+ void draw(Mf::Engine& engine, Mf::Scalar alpha) const;
+ bool handleEvent(Mf::Engine& engine, const Mf::Event& event);
+
+ struct State
+ {
+ // the script object must be mutable because some script functions must be
+ // called during draw
+ mutable Mf::Script script;
+ std::vector<std::string> sceneList;
+
+ HeroineP heroine;
+ SceneP scene;
- Mf::Sound music;
+ Mf::PolynomialInterpolator<5> interp;
+
+ Mf::Camera camera;
+ };
+
+private:
- CharacterP heroine;
- Mf::Sound punchSound;
+ void loadSceneLoader();
+ void advanceScene();
- Mf::PolynomialInterpolator<5> interp;
- Mf::Lerp fadeIn;
+ Mf::Scalar getZCoord(const Mf::Vector2& position) const;
- Mf::Camera camera;
- Mf::OctreeP octree;
+ void setProjection();
+ void setProjection(Mf::Scalar width, Mf::Scalar height);
- HudP hud;
+ State mState;
+ Mf::Sound mMusic;
+ Mf::Sound mPunchSound;
};