Last change
on this file since 2019 was
1956,
checked in by bensch, 20 years ago
|
orxonox/trunk: now the Trunk should be merged with the new Makefile. Hopefully it works
|
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 | |
---|
| 18 | |
---|
| 19 | #include "input_output.h" |
---|
| 20 | #include <iostream> |
---|
| 21 | |
---|
| 22 | using namespace std; |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | /** |
---|
| 26 | \brief InputOutput Module for each player |
---|
| 27 | \param wld A reference to the game-world |
---|
| 28 | |
---|
| 29 | This Class registers all moves, a player makes and passes it to the player object. ToDo: extend to support network players... |
---|
| 30 | */ |
---|
| 31 | InputOutput::InputOutput (World* world, Player* player) |
---|
| 32 | { |
---|
| 33 | this->world = world; |
---|
| 34 | this->player = player; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | InputOutput::~InputOutput () {} |
---|
| 40 | |
---|
| 41 | |
---|
[1900] | 42 | void InputOutput::setPlayerStep(float step) |
---|
| 43 | { |
---|
| 44 | cout << "setting player step to: " << step << endl; |
---|
| 45 | this->step = step; |
---|
| 46 | } |
---|
[1872] | 47 | |
---|
[1900] | 48 | |
---|
[1872] | 49 | void InputOutput::goUp() |
---|
| 50 | { |
---|
[1896] | 51 | //cout << "InoutOutput::goUp" << endl; |
---|
[1900] | 52 | (*player).goY(step); |
---|
[1872] | 53 | } |
---|
| 54 | |
---|
| 55 | void InputOutput::goDown() |
---|
| 56 | { |
---|
[1900] | 57 | (*player).goY(-step); |
---|
[1872] | 58 | } |
---|
| 59 | |
---|
| 60 | void InputOutput::goLeft() |
---|
| 61 | { |
---|
[1900] | 62 | (*player).goX(-step); |
---|
[1879] | 63 | |
---|
[1872] | 64 | } |
---|
| 65 | |
---|
| 66 | void InputOutput::goRight() |
---|
| 67 | { |
---|
[1879] | 68 | |
---|
[1900] | 69 | (*player).goX(step); |
---|
[1872] | 70 | } |
---|
| 71 | |
---|
| 72 | void InputOutput::shoot() |
---|
| 73 | { |
---|
[1879] | 74 | (*player).shoot(1); |
---|
[1872] | 75 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.