/minild29

To get this branch, use:
bzr branch /bzr/minild29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "Monocle.h"
#include "Graphics/SpriteAnimation.h"
#include "LevelEditor/LevelEditor.h"

using namespace Monocle;

namespace Dark
{
  class Player : public Entity
  {
  public:
    Player();
    void Update();

    Vector2 velocity;
    float noisiness;

    SpriteAnimation *sprite;
    Entity *dark;
    AudioDeck *footsteps;

    int const FRICTION;
    float const MAXSPEED;
    int const ACCELERATION;    
  };

  class Creature : public Entity
  {
  public:
    Creature();
    void Update();

    Vector2 velocity;
    Vector2 direction;
    float aiTime;
    float noiseTime;
    float graceTime;
    std::string state;
    float maxspeed;

    SpriteAnimation *sprite;
    AudioDeck *skitter1;
    AudioAsset *alert;
    AudioDeck *sniff;
    AudioAsset *freakout;
    AudioAsset *chomp;

    int const FRICTION;
    int const ACCELERATION;
    float const DEFAULT_MAXSPEED;
    float const STALKSPEED;
    //float const HUNTSPEED;
  };

  class Ping : public Entity
  {
  public:
    Ping();
    void Update();
    static Ping *NewPing(Vector2 pos, float d1, float d2, float t2);

    float d1, d2, t, t2;

    Sprite *sprite;
  };

  class DarkScene : public Scene
  {
  public:
    DarkScene();
    void Begin();
    void Update();
    void HideSpawners();
    void ShowSpawners();
    void Spawn();

    LevelEditor *levelEditor;
    
    Player *player;
  };

  class Text: public Entity
  {
  public:
    Text(const std::string& text, FontAsset* font=NULL);
    
    void Render();
    
    void SetFont(FontAsset* font) { this->font = font; }
    void SetText(const std::string& text) { this->text = text; }
    
  protected:
    FontAsset* font;
    std::string text;
  };
}