Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Progress
Enemies added
- Loading branch information
Showing
63 changed files
with
28,070 additions
and
1,801 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Platformer/Assets/Audio/Music.meta → Platformer/Assets/Animations/Bee.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!91 &9100000 | ||
AnimatorController: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: Bee | ||
serializedVersion: 5 | ||
m_AnimatorParameters: | ||
- m_Name: idle | ||
m_Type: 4 | ||
m_DefaultFloat: 0 | ||
m_DefaultInt: 0 | ||
m_DefaultBool: 0 | ||
m_Controller: {fileID: 0} | ||
m_AnimatorLayers: | ||
- serializedVersion: 5 | ||
m_Name: Base Layer | ||
m_StateMachine: {fileID: 1107178052106744480} | ||
m_Mask: {fileID: 0} | ||
m_Motions: [] | ||
m_Behaviours: [] | ||
m_BlendingMode: 0 | ||
m_SyncedLayerIndex: -1 | ||
m_DefaultWeight: 0 | ||
m_IKPass: 0 | ||
m_SyncedLayerAffectsTiming: 0 | ||
m_Controller: {fileID: 9100000} | ||
--- !u!1102 &1102031004243537786 | ||
AnimatorState: | ||
serializedVersion: 5 | ||
m_ObjectHideFlags: 1 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: idle | ||
m_Speed: 1 | ||
m_CycleOffset: 0 | ||
m_Transitions: [] | ||
m_StateMachineBehaviours: [] | ||
m_Position: {x: 50, y: 50, z: 0} | ||
m_IKOnFeet: 0 | ||
m_WriteDefaultValues: 1 | ||
m_Mirror: 0 | ||
m_SpeedParameterActive: 0 | ||
m_MirrorParameterActive: 0 | ||
m_CycleOffsetParameterActive: 0 | ||
m_TimeParameterActive: 0 | ||
m_Motion: {fileID: 7400000, guid: 7ae4e490c693c004f8195967a9b95a56, type: 2} | ||
m_Tag: | ||
m_SpeedParameter: | ||
m_MirrorParameter: | ||
m_CycleOffsetParameter: | ||
m_TimeParameter: | ||
--- !u!1107 &1107178052106744480 | ||
AnimatorStateMachine: | ||
serializedVersion: 5 | ||
m_ObjectHideFlags: 1 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: Base Layer | ||
m_ChildStates: | ||
- serializedVersion: 1 | ||
m_State: {fileID: 1102031004243537786} | ||
m_Position: {x: 200, y: 0, z: 0} | ||
m_ChildStateMachines: [] | ||
m_AnyStateTransitions: [] | ||
m_EntryTransitions: [] | ||
m_StateMachineTransitions: {} | ||
m_StateMachineBehaviours: [] | ||
m_AnyStatePosition: {x: 50, y: 20, z: 0} | ||
m_EntryPosition: {x: 50, y: 120, z: 0} | ||
m_ExitPosition: {x: 800, y: 120, z: 0} | ||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} | ||
m_DefaultState: {fileID: 1102031004243537786} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!74 &7400000 | ||
AnimationClip: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_Name: idle | ||
serializedVersion: 6 | ||
m_Legacy: 0 | ||
m_Compressed: 0 | ||
m_UseHighQualityCurve: 1 | ||
m_RotationCurves: [] | ||
m_CompressedRotationCurves: [] | ||
m_EulerCurves: [] | ||
m_PositionCurves: [] | ||
m_ScaleCurves: [] | ||
m_FloatCurves: [] | ||
m_PPtrCurves: | ||
- curve: | ||
- time: 0 | ||
value: {fileID: 21300000, guid: ebec7c2e72b1e924bbdfdcb8f6c3d798, type: 3} | ||
- time: 0.14285715 | ||
value: {fileID: 21300000, guid: f9856202f128f194aa6d3e8c06f0672c, type: 3} | ||
- time: 0.2857143 | ||
value: {fileID: 21300000, guid: ebec7c2e72b1e924bbdfdcb8f6c3d798, type: 3} | ||
- time: 0.42857143 | ||
value: {fileID: 21300000, guid: f9856202f128f194aa6d3e8c06f0672c, type: 3} | ||
attribute: m_Sprite | ||
path: | ||
classID: 212 | ||
script: {fileID: 0} | ||
m_SampleRate: 7 | ||
m_WrapMode: 0 | ||
m_Bounds: | ||
m_Center: {x: 0, y: 0, z: 0} | ||
m_Extent: {x: 0, y: 0, z: 0} | ||
m_ClipBindingConstant: | ||
genericBindings: | ||
- serializedVersion: 2 | ||
path: 0 | ||
attribute: 0 | ||
script: {fileID: 0} | ||
typeID: 212 | ||
customType: 23 | ||
isPPtrCurve: 1 | ||
pptrCurveMapping: | ||
- {fileID: 21300000, guid: ebec7c2e72b1e924bbdfdcb8f6c3d798, type: 3} | ||
- {fileID: 21300000, guid: f9856202f128f194aa6d3e8c06f0672c, type: 3} | ||
- {fileID: 21300000, guid: ebec7c2e72b1e924bbdfdcb8f6c3d798, type: 3} | ||
- {fileID: 21300000, guid: f9856202f128f194aa6d3e8c06f0672c, type: 3} | ||
m_AnimationClipSettings: | ||
serializedVersion: 2 | ||
m_AdditiveReferencePoseClip: {fileID: 0} | ||
m_AdditiveReferencePoseTime: 0 | ||
m_StartTime: 0 | ||
m_StopTime: 0.5714286 | ||
m_OrientationOffsetY: 0 | ||
m_Level: 0 | ||
m_CycleOffset: 0 | ||
m_HasAdditiveReferencePose: 0 | ||
m_LoopTime: 1 | ||
m_LoopBlend: 0 | ||
m_LoopBlendOrientation: 0 | ||
m_LoopBlendPositionY: 0 | ||
m_LoopBlendPositionXZ: 0 | ||
m_KeepOriginalOrientation: 0 | ||
m_KeepOriginalPositionY: 1 | ||
m_KeepOriginalPositionXZ: 0 | ||
m_HeightFromFeet: 0 | ||
m_Mirror: 0 | ||
m_EditorCurves: [] | ||
m_EulerEditorCurves: [] | ||
m_HasGenericRootTransform: 0 | ||
m_HasMotionFloatCurves: 0 | ||
m_Events: [] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class Bee_Enemy : MonoBehaviour | ||
{ | ||
|
||
public Animator animator; | ||
public float maxHealth = 75; //health | ||
public float currentHealth; | ||
|
||
public GameObject healthBarUI; | ||
public Slider slider; | ||
public GameObject enemie; | ||
public Transform ghost; | ||
|
||
public int Shurikendamage = 10; | ||
|
||
public GameObject score; //shuriken | ||
|
||
|
||
|
||
void Start() | ||
{ | ||
currentHealth = maxHealth; | ||
slider.value = CalculateHealth(); | ||
ghost.position = new Vector3(ghost.position.x, ghost.position.y, ghost.position.z); | ||
|
||
} | ||
|
||
void Update() | ||
{ | ||
slider.value = CalculateHealth(); | ||
|
||
if (currentHealth < maxHealth) | ||
{ | ||
healthBarUI.SetActive(true); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
public void TakeDamage(int damage) | ||
{ | ||
healthBarUI.SetActive(true); | ||
|
||
currentHealth -= damage; | ||
slider.value = CalculateHealth(); | ||
|
||
//Hurt Animation | ||
SoundManagerScript.PlaySound("GhostHurt"); | ||
animator.SetTrigger("Hurt"); | ||
if (currentHealth <= 0) | ||
{ | ||
Instantiate(score, new Vector3(ghost.position.x, ghost.position.y, ghost.position.z), Quaternion.identity); | ||
|
||
animator.SetBool("IsDead", true); | ||
Die(); | ||
} | ||
} | ||
|
||
void Die() | ||
{ | ||
enemie.SetActive(false); | ||
|
||
} | ||
|
||
private void OnTriggerEnter2D(Collider2D other) | ||
{ | ||
if (other.gameObject.CompareTag("Bullet")) | ||
{ | ||
other.gameObject.SetActive(false); | ||
TakeDamage(Shurikendamage); | ||
healthBarUI.SetActive(true); | ||
slider.value = CalculateHealth(); | ||
SoundManagerScript.PlaySound("GhostHurt"); | ||
} | ||
|
||
} | ||
|
||
float CalculateHealth() | ||
{ | ||
return currentHealth / maxHealth; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class EnemyPatrol : MonoBehaviour | ||
{ | ||
public bool moveRight; | ||
public static float speed; | ||
public GameObject Ghost; | ||
|
||
void Start() | ||
{ | ||
speed = (Random.Range(1f, 1.5f)); | ||
Rigidbody2D rigidbody = GetComponent<Rigidbody2D>(); | ||
rigidbody.velocity = transform.right * speed; | ||
} | ||
|
||
void Update() | ||
{ | ||
if (moveRight) | ||
{ | ||
transform.Translate(2 * Time.deltaTime * speed, 0, 0); | ||
transform.localScale =new Vector3(-1, 1,1); | ||
} | ||
|
||
if (moveRight == false) | ||
{ | ||
|
||
transform.Translate(2 * Time.deltaTime * -(speed*2), 0, 0); | ||
transform.localScale = new Vector3(1, 1,1); | ||
|
||
} | ||
} | ||
|
||
void OnTriggerEnter2D(Collider2D other) //Pickups | ||
{ | ||
if (other.gameObject.CompareTag("turn")) //If you got the key | ||
{ | ||
moveRight = false; | ||
} | ||
|
||
if (other.gameObject.CompareTag("turnback")) //go right | ||
{ | ||
moveRight = true; | ||
} | ||
|
||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.