source: trunk/monsterz/game.cpp @ 289

Last change on this file since 289 was 289, checked in by sam, 11 years ago

Change the way the Scene object works.

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1//
2// Monsterz
3//
4// Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <cstdio>
16
17#include "core.h"
18#include "game.h"
19
20/*
21 * Game implementation class
22 */
23
24class GameData
25{
26    friend class Game;
27
28private:
29    int x, y;
30    int mousex, mousey;
31    int done;
32};
33
34/*
35 * Public Game class
36 */
37
38Game::Game()
39  : data(new GameData())
40{
41    data->x = data->y = 0;
42    data->done = 0;
43}
44
45Game::~Game()
46{
47    delete data;
48}
49
50void Game::TickGame(float deltams)
51{
52    Entity::TickGame(deltams);
53}
54
55void Game::TickDraw(float deltams)
56{
57    Entity::TickDraw(deltams);
58}
59
60void Game::SetMouse(int x, int y)
61{
62    data->mousex = x;
63    data->mousey = y;
64}
65
66void Game::Quit()
67{
68    data->done = 1;
69}
70
71int Game::Finished()
72{
73    return data->done;
74}
75
Note: See TracBrowser for help on using the repository browser.