Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/mount_points/src/util/singleplayer_shootemup.cc @ 10068

Last change on this file since 10068 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 2.2 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific:
12   main-programmer: Patrick Boenzli
13*/
14
15#define DEBUG_MODULE_GAME_RULES
16
17#include "singleplayer_shootemup.h"
18
19#include "util/loading/load_param.h"
20#include "util/loading/factory.h"
21
22#include "mission_goal.h"
23
24
25
26
27#include "class_id_DEPRECATED.h"
28ObjectListDefinitionID(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP);
29CREATE_FACTORY(SingleplayerShootemup);
30
31/**
32 * constructor
33 */
34SingleplayerShootemup::SingleplayerShootemup(const TiXmlElement* root)
35  : GameRules(root)
36{
37  this->registerObject(this, SingleplayerShootemup::_objectList);
38
39  if( root != NULL)
40    this->loadParams(root);
41}
42
43/**
44 * decontsructor
45 */
46SingleplayerShootemup::~SingleplayerShootemup()
47{
48}
49
50
51
52void SingleplayerShootemup::loadParams(const TiXmlElement* root)
53{
54  GameRules::loadParams(root) ;
55
56   LoadParam(root, "death-screen-image", this, SingleplayerShootemup, setDeathScreen)
57       .describe("sets the death screen image");
58
59}
60
61
62
63void SingleplayerShootemup::setDeathScreen(const std::string& imageName)
64{}
65
66
67
68/**
69 * called when the player enters the game
70 * @param player the spawned player
71 */
72void SingleplayerShootemup::onPlayerSpawn()
73{
74}
75
76
77/**
78 * when the player is killed
79 * @param player the killed player
80 */
81void SingleplayerShootemup::onPlayerDeath()
82{
83}
84
85
86/**
87 * time tick
88 * @param dt time
89 */
90void SingleplayerShootemup::tick(float dt)
91{
92  this->checkGameRules(dt);
93}
94
95
96/**
97 * draws the stuff
98 */
99void SingleplayerShootemup::draw()
100{}
101
102
103/**
104 * check the game rules for consistency
105 */
106void SingleplayerShootemup::checkGameRules(float dt)
107{
108//   PRINTF(0)("===========| Printing Mission State:\n");
109  for (std::vector<MissionGoal*>::iterator it = this->missionList.begin(); it != this->missionList.end(); it++)
110  {
111    if( (*it)->checkMissionGoal(dt) != MS_ACCOMPLISHED)
112    {
113//       PRINTF(0)("  Mission \"%s\" is not finished yet\n", (*it)->getMissionName().c_str());
114    }
115  }
116}
117
118
119
120
121
122
Note: See TracBrowser for help on using the repository browser.