public void creatEnemies() { for (int i = 0; i < EnemyNum; i++) { int[] tp = pickAplace(); ObjectEnemy oe = new ObjectEnemy(tp [0], tp [1], 0); obj_list.addObj(oe); } }
public void creatEnemies() { for (int i = 0; i < EnemyNum; i++) { int[] tp = pickAplace(); ObjectEnemy oe = new ObjectEnemy(tp [0], tp [1], Random.Range(0, 2)); //生成敌人的类型 obj_list.addObj(oe); } }
internal static GameStatus CreatTestGame() { GameStatus tempGameStatus = new GameStatus { TheMap = LoadMapObjectFromFile("test1") }; // GameStatus tempGameStatus = new GameStatus {TheMap = Map.Map.CreateTestMap()}; ObjectPlayer tempPlayer = new ObjectPlayer(ObjectGame.ObjcetIds.Player) { Location = new Vector3(10.3f, 0.0f, 5.6f) }; tempGameStatus.ThePlayer = tempPlayer; tempGameStatus.GameObjects.Add(tempPlayer); ObjectEnemy tempEnemy = new ObjectEnemy(ObjectGame.ObjcetIds.Enemy) { Location = new Vector3(15.0, 0.0, 20.0) }; tempGameStatus.GameObjects.Add(tempEnemy); ObjectTurret tempTurret = new ObjectTurret(ObjectGame.ObjcetIds.Turret) { Location = new Vector3(20.0f, 0.0f, 20.0f), Orientation = new Vector3(0.0, 0.0f, 1.0), OrientationTower = 0.5f // OrientationTower = new Vector3(0.5, 0.0f, 0.5) }; tempGameStatus.GameObjects.Add(tempTurret); tempTurret = new ObjectTurret(ObjectGame.ObjcetIds.Turret) { Location = new Vector3(30.0f, 0.0f, 25.0f), Orientation = new Vector3(0.0f, 0.0f, 1.0f), OrientationTower = 0.1f // OrientationTower = new Vector3(0.5f, 0.0f, 0.5f) }; tempGameStatus.GameObjects.Add(tempTurret); tempTurret = new ObjectTurret(ObjectGame.ObjcetIds.Turret) { Location = new Vector3(31, 0.0f, 22), Orientation = new Vector3(0.0, 0.0f, 1.0), OrientationTower = 1.0f // OrientationTower = new Vector3(0.5, 0.0f, 0.5) }; tempGameStatus.GameObjects.Add(tempTurret); tempTurret = new ObjectTurret(ObjectGame.ObjcetIds.Turret) { Location = new Vector3(27, 0.0f, 18), Orientation = new Vector3(0.0, 0.0f, 1.0), OrientationTower = 2.7f // OrientationTower = new Vector3(0.5, 0.0f, 0.5) }; tempGameStatus.GameObjects.Add(tempTurret); return(tempGameStatus); }