Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/input_output.cc @ 2043

Last change on this file since 2043 was 2036, checked in by patrick, 20 years ago

orxonxo/trunk/src: extended framework: class inheritance, right including (had som bugs), framework not finished yet

File size: 1.3 KB
Line 
1
2
3/*
4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific:
14   main-programmer: ...
15   co-programmer: ...
16*/
17
18#include <iostream>
19
20#include "world.h"
21#include "input_output.h"
22#include "player.h"
23
24#include "input_output.h"
25
26using namespace std;
27
28
29/**
30   \brief InputOutput Module for each player
31   \param wld A reference to the game-world
32   
33   This Class registers all moves, a player makes and passes it to the player object. ToDo: extend to support network players...
34*/
35InputOutput::InputOutput (World* world, Player* player) 
36{
37  this->world = world;
38  this->player = player;
39}
40
41
42
43InputOutput::~InputOutput () {}
44
45
46void InputOutput::setPlayerStep(float step)
47{
48  cout << "setting player step to: " << step << endl;
49  this->step = step;
50}
51
52
53void InputOutput::goUp() 
54{
55  //cout << "InoutOutput::goUp" << endl;
56  (*player).goY(step);
57}
58
59void InputOutput::goDown() 
60{
61  (*player).goY(-step);
62}
63
64void InputOutput::goLeft()
65{
66  (*player).goX(-step);
67
68}
69
70void InputOutput::goRight()
71{
72
73  (*player).goX(step);
74}
75
76void InputOutput::shoot()
77{
78  (*player).shoot(1);
79}
Note: See TracBrowser for help on using the repository browser.