1
0
Fork 0

Win with the flag

(TODO for the flag)
This commit is contained in:
Piegames 2018-04-23 19:39:37 +02:00
parent db72c6a707
commit 5717dd259b
4 changed files with 15 additions and 9 deletions

View file

@ -1409,6 +1409,7 @@ MonoBehaviour:
RockLUR: {fileID: 1938166751346222, guid: 6b83a6a46c57a634fa5085684bad0085, type: 2}
RockURD: {fileID: 1437035058628240, guid: 30338afac8ce7054fbff8de89db815e8, type: 2}
RockLRD: {fileID: 1251219893662246, guid: e37e0c5d4b013304cbcb32b223264452, type: 2}
Flag: {fileID: 1971451785855062, guid: ff87b9de73979cd40a9853419833a91f, type: 2}
playerPrefab: {fileID: 1679161327080020, guid: 3d1911457c1e44f53b6b4044334db52f,
type: 2}
ui: {fileID: 1379476069}

View file

@ -70,6 +70,8 @@ public class GameController : MonoBehaviour {
GameObject RockURD;
[SerializeField]
GameObject RockLRD;
[SerializeField]
GameObject Flag;
private Dictionary<GenerationProcessor.ExtendedTileType, GameObject> genPrefabs;
private Dictionary<Enemy.Enemys, GameObject> enemyPrefabs;
@ -128,7 +130,8 @@ public class GameController : MonoBehaviour {
{ GenerationProcessor.ExtendedTileType.Ground2, Ground2 },
{ GenerationProcessor.ExtendedTileType.Ground3, Ground3 },
{ GenerationProcessor.ExtendedTileType.DoorInner, DoorInner },
{ GenerationProcessor.ExtendedTileType.DoorOuter, DoorOuter }
{ GenerationProcessor.ExtendedTileType.DoorOuter, DoorOuter },
{ GenerationProcessor.ExtendedTileType.Flag, Flag }
};
enemyPrefabs = new Dictionary<Enemy.Enemys, GameObject> {
{ Enemy.Enemys.SCORPION, scorpion }
@ -228,6 +231,7 @@ public class GameController : MonoBehaviour {
finish.SetDoorsRootObject(doorRootf);
finish.Reload();
finish.transform.SetParent(mapRoot.transform);
gp.CreateGOFromType(finish.GetCenter(), 0, Room.TileType.DOOR, GenerationProcessor.ExtendedTileType.Flag, goFinish);
// Other Rooms
foreach (GenRoom gr in dg.rooms) {

View file

@ -4,7 +4,7 @@ using UnityEngine;
public class GenerationProcessor {
public enum ExtendedTileType {
BorderOuter, BorderInner, BorderSingle, Ground0, Ground1, Ground2, Ground3, DoorInner, DoorOuter, Rock, RockL, RockU, RockR, RockD, RockLU, RockLR, RockLD, RockUR, RockUD, RockRD, RockLURD, RockLUD, RockLUR, RockURD, RockLRD
BorderOuter, BorderInner, BorderSingle, Ground0, Ground1, Ground2, Ground3, DoorInner, DoorOuter, Rock, RockL, RockU, RockR, RockD, RockLU, RockLR, RockLD, RockUR, RockUD, RockRD, RockLURD, RockLUD, RockLUR, RockURD, RockLRD, Flag
}
Dictionary<ExtendedTileType, GameObject> prefabs;
public GenerationProcessor(Dictionary<ExtendedTileType, GameObject> prefabs) {
@ -39,7 +39,7 @@ public class GenerationProcessor {
return root;
}
private GameObject CreateGOFromType(Vector2 v, int rotation, Room.TileType type, ExtendedTileType t, GameObject root) {
public GameObject CreateGOFromType(Vector2 v, int rotation, Room.TileType type, ExtendedTileType t, GameObject root) {
GameObject tmp = null;
if (type != Room.TileType.GROUND)
CreateGOFromType(v, 0, Room.TileType.GROUND, GetRandomGroundType(), root);

View file

@ -13,6 +13,7 @@ public class FinishObjective : Objective {
}
public override void UpdateGoal() {
if ((room.GetCenter() - (Vector2)player.transform.position).magnitude < 2)
ReachedGoal();
}