Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 2080 was 2036, checked in by patrick, 21 years ago

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

File size: 1.3 KB
RevLine 
[1872]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
[2036]18#include <iostream>
[1872]19
[2036]20#include "world.h"
[1872]21#include "input_output.h"
[2036]22#include "player.h"
[1872]23
[2036]24#include "input_output.h"
25
[1872]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
[1900]46void InputOutput::setPlayerStep(float step)
47{
48  cout << "setting player step to: " << step << endl;
49  this->step = step;
50}
[1872]51
[1900]52
[1872]53void InputOutput::goUp() 
54{
[1896]55  //cout << "InoutOutput::goUp" << endl;
[1900]56  (*player).goY(step);
[1872]57}
58
59void InputOutput::goDown() 
60{
[1900]61  (*player).goY(-step);
[1872]62}
63
64void InputOutput::goLeft()
65{
[1900]66  (*player).goX(-step);
[1879]67
[1872]68}
69
70void InputOutput::goRight()
71{
[1879]72
[1900]73  (*player).goX(step);
[1872]74}
75
76void InputOutput::shoot()
77{
[1879]78  (*player).shoot(1);
[1872]79}
Note: See TracBrowser for help on using the repository browser.