Skip to content

Commit

Permalink
Deliwar_0.1
Browse files Browse the repository at this point in the history
- Bug Fixes
- Extra Audio (foot steps, Attack VFX, Fight music)
- Esc button (Reset the game and back to Main menu)
  • Loading branch information
GraphicEdit committed May 2, 2023
1 parent d27377f commit 4f46e72
Show file tree
Hide file tree
Showing 20 changed files with 1,117 additions and 41 deletions.
Binary file not shown.
22 changes: 22 additions & 0 deletions LD53/Assets/Audio/Char SFX/Attack Hit Sound/attack4X.wav.meta

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

Binary file added LD53/Assets/Audio/Char SFX/Box Walking/Walk5X.wav
Binary file not shown.
22 changes: 22 additions & 0 deletions LD53/Assets/Audio/Char SFX/Box Walking/Walk5X.wav.meta

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

30 changes: 30 additions & 0 deletions LD53/Assets/Code/ActionZone.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class ActionZone : MonoBehaviour
{

AudioSource audioSource;
public AudioClip audioClip;

void Start()
{
audioSource = GetComponent<AudioSource>();
}

private void OnTriggerEnter2D(Collider2D collision)
{
audioSource.PlayOneShot(audioClip, 0.7F);
}

void OnTriggerExit2D(Collider2D other)
{
audioSource.Stop();
}



}
11 changes: 11 additions & 0 deletions LD53/Assets/Code/ActionZone.cs.meta

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

26 changes: 26 additions & 0 deletions LD53/Assets/Code/AttackVFX.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AttackVFX : MonoBehaviour
{

AudioSource audioSource;
public AudioClip attackA;

void Start()
{
audioSource = GetComponent<AudioSource>();
}

void Update()
{
if (Input.GetKeyDown("f"))
{

audioSource.PlayOneShot(attackA, 0.7F);
}

}
}
11 changes: 11 additions & 0 deletions LD53/Assets/Code/AttackVFX.cs.meta

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

16 changes: 1 addition & 15 deletions LD53/Assets/Code/BacktoMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,8 @@ public class BacktoMenu : MonoBehaviour

public void Back()
{
//SceneManager.LoadScene("Menu_GameVictory");

SceneManager.LoadScene("Menu_Start");
}


private void OnTriggerEnter2D(Collider2D collision)
{

SceneManager.LoadScene("Menu_GameVictory");


}






}
2 changes: 1 addition & 1 deletion LD53/Assets/Code/HealthBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void SetDamage(int damage)
{
CurrentHealth = 0;
OnDead?.Invoke();
SceneManager.LoadScene("Menu_GameOver");

}
healthSlider.value = CurrentHealth;
}
Expand Down
17 changes: 17 additions & 0 deletions LD53/Assets/Code/Pause.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Pause : MonoBehaviour
{


void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
SceneManager.LoadScene("Menu_Start");
}
}
}
11 changes: 11 additions & 0 deletions LD53/Assets/Code/Pause.cs.meta

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

35 changes: 35 additions & 0 deletions LD53/Assets/Code/PlayerFootstepSound.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerFootstepSound : MonoBehaviour
{
List<UnityEngine.KeyCode> keys = new List<UnityEngine.KeyCode>();

private AudioSource audioSource;
public AudioClip steps;

void Start()
{
audioSource = gameObject.GetComponent<AudioSource>();

keys.Add(KeyCode.W);
keys.Add(KeyCode.S);
keys.Add(KeyCode.A);
keys.Add(KeyCode.D);
keys.Add(KeyCode.UpArrow);
keys.Add(KeyCode.DownArrow);
keys.Add(KeyCode.LeftArrow);
keys.Add(KeyCode.RightArrow);
}

void Update()
{
if (keys.Exists(key => Input.GetKeyDown(key)))
{
audioSource.PlayOneShot(steps, 0.7F);
}


}
}
11 changes: 11 additions & 0 deletions LD53/Assets/Code/PlayerFootstepSound.cs.meta

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

4 changes: 2 additions & 2 deletions LD53/Assets/Code/PlayerScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void CheckState()
private IEnumerator CheckEnemy()
{
yield return new WaitForSeconds(hurtAfterAttack);
var col = Physics2D.OverlapCircle(transform.position + new Vector3(transform.localScale.x * meleeAttackRange, 0,0), meleeAttackRange,
var col = Physics2D.OverlapCircle(transform.position + new Vector3(transform.localScale.x * meleeAttackRange, 0, 0), meleeAttackRange,
LayerConstants.EnemyLayerMask);

if (col)
Expand Down Expand Up @@ -208,7 +208,7 @@ private void OnDrawGizmos()
{
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(transform.position, groundCheckDistance);
Gizmos.DrawWireSphere(transform.position + new Vector3(transform.localScale.x * meleeAttackRange, 0,0),
Gizmos.DrawWireSphere(transform.position + new Vector3(transform.localScale.x * meleeAttackRange, 0, 0),
meleeAttackRange);
}

Expand Down

0 comments on commit 4f46e72

Please sign in to comment.