/* * MyData.cpp * Hello2 * * Created by Hackenslacker on Mon Apr 05 2004. * Copyright (c) 2004 __MyCompanyName__. All rights reserved. * */ #include "GameData.h" #define KEY_LEFT 28 #define KEY_RIGHT 29 #define KEY_UP 30 #define KEY_DOWN 31 GameData::GameData() { thrusting=turningLeft=turningRight=firing=false; thrust=30; // up arrow turnLeft=28; // left arrow turnRight=29; // right arrow fire=32; // space bar } void GameData::setGameWindowRef(WindowRef &A) { gameWindow=A; } void GameData::setWindowSize(Rect &R) { windowSize=R; } WindowRef GameData::getGameWindowRef() { return gameWindow; } void GameData::keyDown(char &c) { if(c==thrust) thrust=true; if(c==turnLeft) turningLeft=true; if(c==turnRight) turningRight=true; if(c==fire) firing=true; } void GameData::keyUp(char &c) { if(c==thrust) thrust=false; if(c==turnLeft) turningLeft=false; if(c==turnRight) turningRight=false; if(c==fire) firing=false; }