This file contains hidden or 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
interface IWitchAbilities | |
{ | |
void Hex(); | |
void Heal(); | |
void Disappear(); | |
void Fire(); | |
void Ice(); | |
void Poison(); | |
} |
This file contains hidden or 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
using System; | |
public abstract class Character | |
{ | |
public int Armor { get; set; } | |
public int Life { get; set; } | |
public abstract void Attack(); | |
public abstract void TakeDamage(int damage); |
This file contains hidden or 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
using System; | |
using UnityEngine; | |
public class Warrior : MonoBehaviour | |
{ | |
public int Armor { get; set; } | |
public int Life { get; set; } | |
public virtual void Attack() | |
{ |
This file contains hidden or 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
public abstract class Character | |
{ | |
public int Armor { get; set; } | |
public int Life { get; set; } | |
public abstract void TakeDamage(int damage); | |
} | |
public class Warrior : Character | |
{ |
This file contains hidden or 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
using UnityEngine; | |
public class DamageManager | |
{ | |
public void CalculateDamage(Character character, int damage) | |
{ | |
private int finalDamage = 0; | |
if(character is Warrior) | |
{ |
This file contains hidden or 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
public class GameConstants | |
{ | |
public const int INITIAL_LIFE = 100; | |
public const string SCORE_TXT = "SCORE: "; | |
public const string LIFE_TXT = "LIFE: "; | |
} |
This file contains hidden or 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
using UnityEngine; | |
public class CombatComponent : MonoBehaviour | |
{ | |
public void PlayerAttacksEnemy(Player player, Enemy enemy) | |
{ | |
if (player != null) | |
{ | |
enemy?.ReceiveDamage(player.Attack); | |
} |
This file contains hidden or 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
using UnityEngine; | |
public class AudioComponent : MonoBehaviour | |
{ | |
//Audio Clips | |
[SerializeField] private AudioClip attackSfx; | |
[SerializeField] private AudioClip playerDeathSfx; | |
//Audio Sources | |
[SerializeField] private AudioSource audioSource; |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
public class UIComponent : MonoBehaviour | |
{ | |
[SerializeField] private Text scoreText; | |
[SerializeField] private Text lifeText; | |
[SerializeField] private Image gameOverOverlay; | |
private void Start() |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.UI; | |
public class GameManager : MonoBehaviour | |
{ | |
public const int INITIAL_LIFE = 100; | |
private const string SCORE_TXT = "SCORE: "; | |
private const string LIFE_TXT = "LIFE: "; | |
//UI |