first commit
This commit is contained in:
58
CS1322/p6/MyWay2/CEngine.java
Normal file
58
CS1322/p6/MyWay2/CEngine.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* <PRE>
|
||||
* CEngine.java
|
||||
*
|
||||
* Revisions: 1.0 Nov. 17, 2002
|
||||
* Created the CEngine class
|
||||
*
|
||||
* </PRE>
|
||||
*
|
||||
* @author <A HREF="mailto:gtg184g@mail.gatech.edu">Jose Manuel Caban</A>
|
||||
* @version Version 1.0, Nov. 17, 2002
|
||||
*/
|
||||
|
||||
public class CEngine {
|
||||
|
||||
public CGhost[] cGhost;
|
||||
public CPacman[] cPacman;
|
||||
public CTile[][] cBgGrid;
|
||||
public CMonster[][] cSpriteLayer;
|
||||
public CNode[][] cNodeLayer;
|
||||
|
||||
public CEngine(String fileName){
|
||||
CFileReader cTemp= new CFileReader();
|
||||
Object[] array = cTemp.readMap(fileName);
|
||||
|
||||
cBgGrid = (CTile[][])array[5];
|
||||
CPacman Pacman = new CPacman((CCoord)array[0]);
|
||||
CGhost Ghost1 = new CGhost((CCoord)array[1]);
|
||||
CGhost Ghost2 = new CGhost((CCoord)array[2]);
|
||||
CGhost Ghost3 = new CGhost((CCoord)array[3]);
|
||||
CGhost Ghost4 = new CGhost((CCoord)array[4]);
|
||||
|
||||
cNodeLayer = (CNode[][])array[6];
|
||||
|
||||
cSpriteLayer = new CMonster[cBgGrid.length][cBgGrid[0].length];
|
||||
cSpriteLayer[Pacman.getX()][Pacman.getY()] = Pacman;
|
||||
cSpriteLayer[Ghost1.getX()][Ghost1.getY()] = Ghost1;
|
||||
cSpriteLayer[Ghost2.getX()][Ghost2.getY()] = Ghost2;
|
||||
cSpriteLayer[Ghost3.getX()][Ghost3.getY()] = Ghost3;
|
||||
cSpriteLayer[Ghost4.getX()][Ghost4.getY()] = Ghost4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Debugging main for class CEngine.
|
||||
* This method will rigorously test my code.
|
||||
*
|
||||
* <br><br>
|
||||
* @param args a String array of command line arguments.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
}// end of main(String[] args)
|
||||
|
||||
}// end of class CEngine
|
||||
Reference in New Issue
Block a user