Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Thursday Update
-Fixed Hero hurt sound
-Fixed ranged enemy attack
  • Loading branch information
lan11001 committed Oct 10, 2013
1 parent e1cf346 commit 961cf0b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
25 changes: 25 additions & 0 deletions Guardian of Silverkeep/Assets/Scenes/GameLevel1.unity
Expand Up @@ -21910,6 +21910,7 @@ GameObject:
- 54: {fileID: 233711991}
- 82: {fileID: 233711992}
- 81: {fileID: 233711993}
- 131: {fileID: 233711994}
m_Layer: 0
m_Name: Hero
m_TagString: Player
Expand Down Expand Up @@ -22052,6 +22053,7 @@ MonoBehaviour:
type: 2}
Hero_Attack_01_Prefab: {fileID: 100000, guid: 548fd220e2a904886aaeae294eed71a8,
type: 2}
heroGetHurt: {fileID: 8300000, guid: e5cc52e974653fa48a92420c6036667d, type: 3}
heroAttack: {fileID: 8300000, guid: 481b9c5915416514c84714836c1f5726, type: 3}
heroGetJoystone: {fileID: 8300000, guid: ce8d709a7b3609f42ab2b569c8201818, type: 3}
--- !u!54 &233711991
Expand Down Expand Up @@ -22135,6 +22137,25 @@ AudioListener:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 233711984}
m_Enabled: 1
--- !u!131 &233711994
GUITexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 233711984}
m_Enabled: 1
m_Texture: {fileID: 0}
m_Color: {r: .5, g: .5, b: .5, a: .5}
m_PixelInset:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_LeftBorder: 0
m_RightBorder: 0
m_TopBorder: 0
m_BottomBorder: 0
--- !u!1 &233851097
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -123365,6 +123386,10 @@ Prefab:
propertyPath: heroGetJoystone
value:
objectReference: {fileID: 8300000, guid: ce8d709a7b3609f42ab2b569c8201818, type: 3}
- target: {fileID: 11400000, guid: 62a6e0865cec44656be439b399ff7f72, type: 2}
propertyPath: heroGetHurt
value:
objectReference: {fileID: 8300000, guid: e5cc52e974653fa48a92420c6036667d, type: 3}
m_RemovedComponents:
- {fileID: 8100000, guid: 62a6e0865cec44656be439b399ff7f72, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: 62a6e0865cec44656be439b399ff7f72, type: 2}
Expand Down
4 changes: 2 additions & 2 deletions Guardian of Silverkeep/Assets/Scripts/EnemyAttack_Range.cs
Expand Up @@ -14,7 +14,7 @@ public class EnemyAttack_Range : MonoBehaviour
// initialization
void Start () {
//hero = (Hero) GameObject.Find("Hero").GetComponent("Hero");
hero = GameObject.Find("Hero");
hero = GameObject.FindWithTag("Player");
//destry itself after some time
StartCoroutine(DestroySelf());
//when initializated, find self pos and hero pos to get projectile direction
Expand All @@ -30,7 +30,7 @@ public class EnemyAttack_Range : MonoBehaviour
void Update ()
{
float amtToMove = ProjectileSpeed * Time.deltaTime;
transform.Translate((heroPosition - selfPosition) * amtToMove / tmpGetOne );
transform.Translate((heroPosition - selfPosition) * amtToMove / tmpGetOne,Space.World );


}
Expand Down
3 changes: 3 additions & 0 deletions Guardian of Silverkeep/Assets/Scripts/FPS_HERO.cs
Expand Up @@ -25,6 +25,8 @@ public class FPS_HERO: MonoBehaviour
private float timeStamp;
private GameObject[] heroRef;
MasterControl masterC;
//public GameObject stuffThatShouldSHowup;
public AudioClip heroGetHurt;
public AudioClip heroAttack;
public AudioClip heroGetJoystone;

Expand Down Expand Up @@ -252,6 +254,7 @@ public class FPS_HERO: MonoBehaviour
{
if(state == State.Playing)
{
audio.PlayOneShot(heroGetHurt);
this.Health -= dmg;
if(this.Health > 0)
StartCoroutine(gotHitCoroutine());
Expand Down

This file was deleted.

0 comments on commit 961cf0b

Please sign in to comment.