source: trunk/deushax/game.cpp @ 1309

Last change on this file since 1309 was 735, checked in by sam, 9 years ago

core: get rid of now useless <cstdio> includes.

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
4//
5
6#if defined HAVE_CONFIG_H
7#   include "config.h"
8#endif
9
10#include "core.h"
11
12using namespace lol;
13
14#include "game.h"
15
16/*
17 * Game implementation class
18 */
19
20class GameData
21{
22    friend class Game;
23
24private:
25    Map *map;
26    int x, y;
27    int mousex, mousey;
28    int done;
29};
30
31/*
32 * Public Game class
33 */
34
35Game::Game(char const *mapname)
36  : data(new GameData())
37{
38    data->map = new Map(mapname);
39    data->x = data->y = 0;
40    data->done = 0;
41}
42
43Game::~Game()
44{
45    delete data->map;
46    delete data;
47}
48
49void Game::TickGame(float deltams)
50{
51    Entity::TickGame(deltams);
52}
53
54void Game::TickDraw(float deltams)
55{
56    Entity::TickDraw(deltams);
57
58    data->map->Render(-data->mousex, -data->mousey, 0);
59}
60
61#if 0
62Scene *Game::GetScene()
63{
64    if (!data->scene)
65        data->scene = new Scene(45.0f);
66    return data->scene;
67}
68#endif
69
70void Game::SetMouse(int x, int y)
71{
72    data->mousex = x;
73    data->mousey = y;
74}
75
76void Game::Quit()
77{
78    data->done = 1;
79}
80
81int Game::Finished()
82{
83    return data->done;
84}
85
Note: See TracBrowser for help on using the repository browser.