Last change
on this file since 2105 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
|
Rev | Line | |
---|
[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] | 26 | using 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 | */ |
---|
| 35 | InputOutput::InputOutput (World* world, Player* player) |
---|
| 36 | { |
---|
| 37 | this->world = world; |
---|
| 38 | this->player = player; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | InputOutput::~InputOutput () {} |
---|
| 44 | |
---|
| 45 | |
---|
[1900] | 46 | void InputOutput::setPlayerStep(float step) |
---|
| 47 | { |
---|
| 48 | cout << "setting player step to: " << step << endl; |
---|
| 49 | this->step = step; |
---|
| 50 | } |
---|
[1872] | 51 | |
---|
[1900] | 52 | |
---|
[1872] | 53 | void InputOutput::goUp() |
---|
| 54 | { |
---|
[1896] | 55 | //cout << "InoutOutput::goUp" << endl; |
---|
[1900] | 56 | (*player).goY(step); |
---|
[1872] | 57 | } |
---|
| 58 | |
---|
| 59 | void InputOutput::goDown() |
---|
| 60 | { |
---|
[1900] | 61 | (*player).goY(-step); |
---|
[1872] | 62 | } |
---|
| 63 | |
---|
| 64 | void InputOutput::goLeft() |
---|
| 65 | { |
---|
[1900] | 66 | (*player).goX(-step); |
---|
[1879] | 67 | |
---|
[1872] | 68 | } |
---|
| 69 | |
---|
| 70 | void InputOutput::goRight() |
---|
| 71 | { |
---|
[1879] | 72 | |
---|
[1900] | 73 | (*player).goX(step); |
---|
[1872] | 74 | } |
---|
| 75 | |
---|
| 76 | void InputOutput::shoot() |
---|
| 77 | { |
---|
[1879] | 78 | (*player).shoot(1); |
---|
[1872] | 79 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.