Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added generator speedup based on scores(currently it gives a speedup …
…signal at 70% victory score)

Gotta get some shuteye, I will add music tonight with the help of john, and will help finish the final scene and add the skybox swap(just one line) as well.
  • Loading branch information
Tianzhu Zhang authored and Tianzhu Zhang committed Oct 9, 2013
1 parent d2a26a2 commit d093d85
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 14 deletions.
Expand Up @@ -14,7 +14,7 @@ GameObject:
- 114: {fileID: 11400000}
m_Layer: 0
m_Name: Enemy_Generator_Big
m_TagString: Untagged
m_TagString: Respawn
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -81,6 +81,7 @@ MonoBehaviour:
Enemy01: {fileID: 100000, guid: 72fa228a88f034a4695da237219fa2b1, type: 2}
Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2}
spawnRate: 5
speedUpRate: .100000001
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
Expand Down
Expand Up @@ -14,7 +14,7 @@ GameObject:
- 114: {fileID: 11400000}
m_Layer: 0
m_Name: Enemy_Generator_Ranged
m_TagString: Untagged
m_TagString: Respawn
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -81,6 +81,7 @@ MonoBehaviour:
Enemy01: {fileID: 100000, guid: 2a0dd2bcb20004d33b9802a3dd4975cf, type: 2}
Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2}
spawnRate: 3
speedUpRate: .100000001
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
Expand Down
Expand Up @@ -14,7 +14,7 @@ GameObject:
- 114: {fileID: 11400000}
m_Layer: 0
m_Name: Enemy_Generator_Weak
m_TagString: Untagged
m_TagString: Respawn
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -81,6 +81,7 @@ MonoBehaviour:
Enemy01: {fileID: 100000, guid: 340017fa6633642cfb262b80ea89268b, type: 2}
Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2}
spawnRate: 5
speedUpRate: .100000001
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
Expand Down
150 changes: 147 additions & 3 deletions Guardian of Silverkeep/Assets/Scene_Tianzhu/LVL1.unity
Expand Up @@ -352,6 +352,46 @@ MeshFilter:
m_PrefabInternal: {fileID: 494628817}
m_GameObject: {fileID: 61694388}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &79484991
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalPosition.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalPosition.z
value: 5
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 08573848214134218864619298070bcf, type: 2}
m_RootGameObject: {fileID: 1803185861}
m_IsPrefabParent: 0
m_IsExploded: 1
--- !u!1 &95018709
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -446,6 +486,10 @@ Prefab:
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: 62a6e0865cec44656be439b399ff7f72, type: 2}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 62a6e0865cec44656be439b399ff7f72, type: 2}
m_RootGameObject: {fileID: 1891145080}
Expand Down Expand Up @@ -2825,7 +2869,7 @@ GameObject:
- 114: {fileID: 993245397}
m_Layer: 0
m_Name: Enemy_Generator_Weak
m_TagString: Untagged
m_TagString: Respawn
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand All @@ -2845,6 +2889,7 @@ MonoBehaviour:
Enemy01: {fileID: 100000, guid: 340017fa6633642cfb262b80ea89268b, type: 2}
Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2}
spawnRate: 5
speedUpRate: .100000001
--- !u!23 &993245398
Renderer:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3306,6 +3351,7 @@ GameObject:
- 124: {fileID: 1139808589}
- 114: {fileID: 1139808588}
- 81: {fileID: 1139808587}
- 114: {fileID: 1139808592}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
Expand Down Expand Up @@ -3340,7 +3386,7 @@ MonoBehaviour:
type: 2}
m_PrefabInternal: {fileID: 107096183}
m_GameObject: {fileID: 1139808585}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ec2fe99d1108b9d0006a298d76c639, type: 3}
m_Name:
Expand Down Expand Up @@ -3397,6 +3443,19 @@ Camera:
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_HDR: 0
--- !u!114 &1139808592
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1139808585}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5e1f5f091bf954b86ade1fbe198851da, type: 3}
m_Name:
m_EditorClassIdentifier:
Win_Cond: 6
Lose_Cond: 0
--- !u!1 &1156734093
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4828,6 +4887,92 @@ MeshFilter:
m_PrefabInternal: {fileID: 56728018}
m_GameObject: {fileID: 1784722914}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1803185861
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100000, guid: 08573848214134218864619298070bcf, type: 2}
m_PrefabInternal: {fileID: 79484991}
serializedVersion: 4
m_Component:
- 4: {fileID: 1803185866}
- 33: {fileID: 1803185865}
- 65: {fileID: 1803185864}
- 23: {fileID: 1803185863}
- 114: {fileID: 1803185862}
m_Layer: 0
m_Name: Enemy_Generator_Big
m_TagString: Respawn
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1803185862
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400000, guid: 08573848214134218864619298070bcf,
type: 2}
m_PrefabInternal: {fileID: 79484991}
m_GameObject: {fileID: 1803185861}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 92397dffa2ddd43f598c8dd8d209af12, type: 3}
m_Name:
m_EditorClassIdentifier:
Enemy01: {fileID: 100000, guid: 72fa228a88f034a4695da237219fa2b1, type: 2}
Villager01: {fileID: 100000, guid: df584aac02f774577a7af7ff72ba5475, type: 2}
spawnRate: 5
speedUpRate: .100000001
--- !u!23 &1803185863
Renderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 2300000, guid: 08573848214134218864619298070bcf,
type: 2}
m_PrefabInternal: {fileID: 79484991}
m_GameObject: {fileID: 1803185861}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: d5f5858f11d9a4b9eb36788f0170b6df, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
--- !u!65 &1803185864
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 6500000, guid: 08573848214134218864619298070bcf,
type: 2}
m_PrefabInternal: {fileID: 79484991}
m_GameObject: {fileID: 1803185861}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1803185865
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 3300000, guid: 08573848214134218864619298070bcf,
type: 2}
m_PrefabInternal: {fileID: 79484991}
m_GameObject: {fileID: 1803185861}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1803185866
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400000, guid: 08573848214134218864619298070bcf, type: 2}
m_PrefabInternal: {fileID: 79484991}
m_GameObject: {fileID: 1803185861}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5, y: 0, z: 5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
--- !u!1 &1849082775
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4990,7 +5135,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
Health: 5
Score: 0
victoryScore: 15
Hero_Attack_03_Prefab: {fileID: 100000, guid: c08fc645757c54e41bfc4a93112e033f,
type: 2}
Hero_Attack_02_Prefab: {fileID: 100000, guid: ef077c06042504317ba49c4177a6e2f7,
Expand Down
6 changes: 6 additions & 0 deletions Guardian of Silverkeep/Assets/Scripts/EnemyGenerator.cs
Expand Up @@ -11,6 +11,7 @@ public class EnemyGenerator : MonoBehaviour
private Vector3 SpawnLocationRandomize;
private float posX;
private float posZ;
public float speedUpRate = 0.1f;
// Use this for initialization
enum CycleStat
{
Expand Down Expand Up @@ -70,4 +71,9 @@ public class EnemyGenerator : MonoBehaviour
Debug.Log("day/night cycle switched!");
}
#endregion
void SpeedUp()
{
this.spawnRate = this.spawnRate * speedUpRate;
Debug.Log("Speed Uped");
}
}
10 changes: 2 additions & 8 deletions Guardian of Silverkeep/Assets/Scripts/FPS_HERO.cs
Expand Up @@ -6,7 +6,7 @@ public class FPS_HERO: MonoBehaviour
#region Fields
public int Health;
public int Score;
public int victoryScore = 15;
//public int victoryScore = 15;
public GameObject Hero_Attack_03_Prefab;
public GameObject Hero_Attack_02_Prefab;
public GameObject Hero_Attack_01_Prefab;
Expand Down Expand Up @@ -53,13 +53,7 @@ public class FPS_HERO: MonoBehaviour

void Update ()
{
#region Win/Lose
if(this.Health <= 0)
Application.LoadLevel("GameOver");
if(this.Score >= victoryScore)
Application.LoadLevel("VictoryScreen");

#endregion


if (state != State.Dead)
{
Expand Down
52 changes: 52 additions & 0 deletions Guardian of Silverkeep/Assets/Scripts/MasterControl.cs
@@ -0,0 +1,52 @@
using UnityEngine;
using System.Collections;

public class MasterControl : MonoBehaviour
{
private FPS_HERO hero;
private GameObject[] eGen;

public int Win_Cond = 40;
public int Lose_Cond = 0;
private bool neverdone = true;

// Use this for initialization
void Start ()
{
hero = (FPS_HERO)FindObjectOfType(typeof(FPS_HERO));
eGen = GameObject.FindGameObjectsWithTag("Respawn");

}
//*** put swap skybox somewhere here**

// Update is called once per frame
void Update ()
{
#region WinLose
if(hero.Health <= Lose_Cond)
Application.LoadLevel("GameOver");
if(hero.Score >= Win_Cond)
Application.LoadLevel("VictoryScreen");
#endregion

#region speedup
if(neverdone ==true)
{
if(hero.Score >= (0.7f * Win_Cond))
{

foreach(GameObject e in eGen)
{
e.SendMessage("SpeedUp");
}

neverdone = false;
}
}
#endregion



}

}
8 changes: 8 additions & 0 deletions Guardian of Silverkeep/Assets/Scripts/MasterControl.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d093d85

Please sign in to comment.