Added dialog system, added new scene, added player stats save
This commit is contained in:
parent
1ea616dd60
commit
232bd25285
@ -10,9 +10,9 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 7305430595602190106}
|
- component: {fileID: 7305430595602190106}
|
||||||
- component: {fileID: 7305430595602190101}
|
- component: {fileID: 7305430595602190101}
|
||||||
- component: {fileID: 7305430595602190100}
|
|
||||||
- component: {fileID: 7305430595602190103}
|
- component: {fileID: 7305430595602190103}
|
||||||
- component: {fileID: -7314408697251460281}
|
- component: {fileID: -7314408697251460281}
|
||||||
|
- component: {fileID: 8941371121625508650}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Portal
|
m_Name: Portal
|
||||||
m_TagString: Portal
|
m_TagString: Portal
|
||||||
@ -85,32 +85,6 @@ SpriteRenderer:
|
|||||||
m_WasSpriteAssigned: 1
|
m_WasSpriteAssigned: 1
|
||||||
m_MaskInteraction: 0
|
m_MaskInteraction: 0
|
||||||
m_SpriteSortPoint: 0
|
m_SpriteSortPoint: 0
|
||||||
--- !u!61 &7305430595602190100
|
|
||||||
BoxCollider2D:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 7305430595602190102}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_Density: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IsTrigger: 1
|
|
||||||
m_UsedByEffector: 0
|
|
||||||
m_UsedByComposite: 0
|
|
||||||
m_Offset: {x: 0, y: 0}
|
|
||||||
m_SpriteTilingProperty:
|
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
pivot: {x: 0.5, y: 0.5}
|
|
||||||
oldSize: {x: 1.1875, y: 1.5}
|
|
||||||
newSize: {x: 1.1875, y: 1.5}
|
|
||||||
adaptiveTilingThreshold: 0.5
|
|
||||||
drawMode: 0
|
|
||||||
adaptiveTiling: 0
|
|
||||||
m_AutoTiling: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Size: {x: 1.1875, y: 1.5}
|
|
||||||
m_EdgeRadius: 0
|
|
||||||
--- !u!95 &7305430595602190103
|
--- !u!95 &7305430595602190103
|
||||||
Animator:
|
Animator:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
@ -142,3 +116,32 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: e2c1030c00bd4a24c81a616643ec6900, type: 3}
|
m_Script: {fileID: 11500000, guid: e2c1030c00bd4a24c81a616643ec6900, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
wins: 0
|
||||||
|
highscore: 0
|
||||||
|
count: {fileID: 0}
|
||||||
|
--- !u!61 &8941371121625508650
|
||||||
|
BoxCollider2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7305430595602190102}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Density: 1
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_UsedByEffector: 0
|
||||||
|
m_UsedByComposite: 0
|
||||||
|
m_Offset: {x: -0.031154841, y: 0.021808386}
|
||||||
|
m_SpriteTilingProperty:
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
oldSize: {x: 1.1875, y: 1.5}
|
||||||
|
newSize: {x: 1.1875, y: 1.5}
|
||||||
|
adaptiveTilingThreshold: 0.5
|
||||||
|
drawMode: 0
|
||||||
|
adaptiveTiling: 0
|
||||||
|
m_AutoTiling: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 0.93826133, y: 1.2694545}
|
||||||
|
m_EdgeRadius: 0
|
||||||
|
@ -164,13 +164,13 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ff9b8433a08e35e4fa50a029b433656c, type: 3}
|
m_Script: {fileID: 11500000, guid: ff9b8433a08e35e4fa50a029b433656c, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
speed: 3
|
speed: 3.5
|
||||||
maxHealth: 2
|
maxHealth: 2
|
||||||
currentHealth: 0
|
currentHealth: 0
|
||||||
enemy: {fileID: 1288833141033372906}
|
enemy: {fileID: 1288833141033372906}
|
||||||
deathEffect: {fileID: 3474156553072057722, guid: 9f3e5c615ff914c4aa28afc0c78490da,
|
deathEffect: {fileID: 3474156553072057722, guid: 9f3e5c615ff914c4aa28afc0c78490da,
|
||||||
type: 3}
|
type: 3}
|
||||||
stoppingDistance: 4
|
stoppingDistance: 6
|
||||||
timer: 2
|
timer: 2
|
||||||
bullet: {fileID: 5467294445753478461, guid: 3e8a34909449d4b4884d06bd487dfb2d, type: 3}
|
bullet: {fileID: 5467294445753478461, guid: 3e8a34909449d4b4884d06bd487dfb2d, type: 3}
|
||||||
text: {fileID: 0}
|
text: {fileID: 0}
|
||||||
|
2615
Assets/Scenes/AgainScene.unity
Normal file
2615
Assets/Scenes/AgainScene.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/AgainScene.unity.meta
Normal file
7
Assets/Scenes/AgainScene.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 63470b932abfcd242b22890a0750954d
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -682,7 +682,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 0.8113208, g: 0.14925243, b: 0.14925243, a: 1}
|
m_Color: {r: 0.9716981, g: 0.27959237, b: 0.27959237, a: 1}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
@ -1142,6 +1142,9 @@ MonoBehaviour:
|
|||||||
deathEffect: {fileID: 5209110736082826299, guid: 67aaa671eb02be04d9684922a07a0923,
|
deathEffect: {fileID: 5209110736082826299, guid: 67aaa671eb02be04d9684922a07a0923,
|
||||||
type: 3}
|
type: 3}
|
||||||
playerTrigger: {fileID: 755451863}
|
playerTrigger: {fileID: 755451863}
|
||||||
|
count: {fileID: 482127932}
|
||||||
|
highscore: 0
|
||||||
|
deaths: 0
|
||||||
--- !u!114 &755451860
|
--- !u!114 &755451860
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
File diff suppressed because it is too large
Load Diff
8
Assets/Scripts/Dialog.meta
Normal file
8
Assets/Scripts/Dialog.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4058dacb7cf03584e8d96bd2fef284e3
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
74
Assets/Scripts/Dialog/Dialog.cs
Normal file
74
Assets/Scripts/Dialog/Dialog.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class Dialog : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Text textBox;
|
||||||
|
public string[] dialogSentences;
|
||||||
|
private int index;
|
||||||
|
public GameObject continueButton;
|
||||||
|
private PlayerController controller;
|
||||||
|
public GameObject player;
|
||||||
|
public GameObject portal;
|
||||||
|
|
||||||
|
public Animator animator;
|
||||||
|
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
player = GameObject.FindWithTag("Player");
|
||||||
|
controller = player.GetComponent<PlayerController>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if(textBox.text == dialogSentences[index])
|
||||||
|
{
|
||||||
|
continueButton.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTriggerEnter2D(Collider2D other)
|
||||||
|
{
|
||||||
|
if (other.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
StartCoroutine(Write());
|
||||||
|
controller.enabled = false;
|
||||||
|
animator.Play("Player_Idle");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator Write()
|
||||||
|
{
|
||||||
|
foreach(char letter in dialogSentences[index].ToCharArray())
|
||||||
|
{
|
||||||
|
textBox.text += letter;
|
||||||
|
yield return new WaitForSeconds(0.05f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Continue()
|
||||||
|
{
|
||||||
|
continueButton.SetActive(false);
|
||||||
|
if (index < dialogSentences.Length - 1)
|
||||||
|
{
|
||||||
|
index++;
|
||||||
|
textBox.text = "";
|
||||||
|
StartCoroutine(Write());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textBox.text = "";
|
||||||
|
controller.enabled = true;
|
||||||
|
continueButton.SetActive(false);
|
||||||
|
portal.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
11
Assets/Scripts/Dialog/Dialog.cs.meta
Normal file
11
Assets/Scripts/Dialog/Dialog.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4ab3e0730fc2b04409b22cef5a35b6c5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -85,4 +85,9 @@ public class EnemyFollowPlayer : MonoBehaviour
|
|||||||
yield return new WaitForSeconds(0.1f);
|
yield return new WaitForSeconds(0.1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnBecameInvisible()
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,17 +38,19 @@ public class RangedEnemyAI : MonoBehaviour
|
|||||||
if (Vector2.Distance(transform.position, target.position) < stoppingDistance)
|
if (Vector2.Distance(transform.position, target.position) < stoppingDistance)
|
||||||
{
|
{
|
||||||
transform.position = this.transform.position;
|
transform.position = this.transform.position;
|
||||||
|
|
||||||
|
if (canShoot <= 0)
|
||||||
|
{
|
||||||
|
Instantiate(bullet, transform.position, Quaternion.identity);
|
||||||
|
canShoot = timer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
canShoot -= Time.deltaTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(canShoot <= 0)
|
|
||||||
{
|
|
||||||
Instantiate(bullet, transform.position, Quaternion.identity);
|
|
||||||
canShoot = timer;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
canShoot -= Time.deltaTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,5 +103,12 @@ public class RangedEnemyAI : MonoBehaviour
|
|||||||
yield return new WaitForSeconds(0.1f);
|
yield return new WaitForSeconds(0.1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnBecameInvisible()
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ public class GameMenu : MonoBehaviour
|
|||||||
{
|
{
|
||||||
public void PlayGame()
|
public void PlayGame()
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene("StartScene");
|
SceneManager.LoadScene("AgainScene");
|
||||||
}
|
}
|
||||||
public void QuitToMenu()
|
public void QuitToMenu()
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,14 @@ public class MainMenu : MonoBehaviour
|
|||||||
{
|
{
|
||||||
public void PlayGame()
|
public void PlayGame()
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene("StartScene");
|
if (PlayerPrefs.GetInt("Deaths") == 0)
|
||||||
|
{
|
||||||
|
SceneManager.LoadScene("StartScene");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SceneManager.LoadScene("AgainScene");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void QuitGame()
|
public void QuitGame()
|
||||||
{
|
{
|
||||||
|
@ -57,8 +57,9 @@ public class PauseMenu : MonoBehaviour
|
|||||||
|
|
||||||
public void LoadMenu()
|
public void LoadMenu()
|
||||||
{
|
{
|
||||||
Resume();
|
|
||||||
SceneManager.LoadScene("MenuScene");
|
SceneManager.LoadScene("MenuScene");
|
||||||
|
Resume();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResumeGame()
|
public void ResumeGame()
|
||||||
|
38
Assets/Scripts/Others/PlayerStats.cs
Normal file
38
Assets/Scripts/Others/PlayerStats.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
|
||||||
|
public class PlayerStats : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Text winsText;
|
||||||
|
public Text deathText;
|
||||||
|
public Text killsText;
|
||||||
|
public Text description;
|
||||||
|
|
||||||
|
void OnTriggerEnter2D(Collider2D other)
|
||||||
|
{
|
||||||
|
if (other.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
description.GetComponent<Text>().enabled = true;
|
||||||
|
winsText.GetComponent<Text>().enabled = true;
|
||||||
|
deathText.GetComponent<Text>().enabled = true;
|
||||||
|
killsText.GetComponent<Text>().enabled = true;
|
||||||
|
winsText.text = PlayerPrefs.GetInt("Wins").ToString();
|
||||||
|
deathText.text = PlayerPrefs.GetInt("Deaths").ToString();
|
||||||
|
killsText.text = PlayerPrefs.GetInt("Kills").ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTriggerExit2D(Collider2D other)
|
||||||
|
{
|
||||||
|
if (other.CompareTag("Player"))
|
||||||
|
{
|
||||||
|
description.GetComponent<Text>().enabled = false;
|
||||||
|
winsText.GetComponent<Text>().enabled = false;
|
||||||
|
deathText.GetComponent<Text>().enabled = false;
|
||||||
|
killsText.GetComponent<Text>().enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Others/PlayerStats.cs.meta
Normal file
11
Assets/Scripts/Others/PlayerStats.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bd696fbee8904fe46891aa6472cf151c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -6,6 +6,18 @@ using UnityEngine.SceneManagement;
|
|||||||
public class WinGame : MonoBehaviour
|
public class WinGame : MonoBehaviour
|
||||||
{
|
{
|
||||||
private GameObject[] gameObjects;
|
private GameObject[] gameObjects;
|
||||||
|
public int wins;
|
||||||
|
public int highscore;
|
||||||
|
private PlayerScore score;
|
||||||
|
public GameObject count;
|
||||||
|
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
count = GameObject.FindGameObjectWithTag("Score");
|
||||||
|
score = count.GetComponent<PlayerScore>();
|
||||||
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
gameObjects = GameObject.FindGameObjectsWithTag("Enemy");
|
gameObjects = GameObject.FindGameObjectsWithTag("Enemy");
|
||||||
@ -16,6 +28,17 @@ void OnTriggerEnter2D(Collider2D other)
|
|||||||
{
|
{
|
||||||
if (other.CompareTag("Player") && gameObjects.Length == 0)
|
if (other.CompareTag("Player") && gameObjects.Length == 0)
|
||||||
{
|
{
|
||||||
|
highscore = 0;
|
||||||
|
wins = 0;
|
||||||
|
|
||||||
|
wins++;
|
||||||
|
wins = PlayerPrefs.GetInt("Wins") + wins;
|
||||||
|
PlayerPrefs.SetInt("Wins", wins);
|
||||||
|
|
||||||
|
highscore = PlayerPrefs.GetInt("Kills") + score.killedEnemy;
|
||||||
|
PlayerPrefs.SetInt("Kills", highscore);
|
||||||
|
Debug.Log(PlayerPrefs.GetInt("Kills").ToString());
|
||||||
|
|
||||||
SceneManager.LoadScene("WinScene");
|
SceneManager.LoadScene("WinScene");
|
||||||
Debug.Log("You won!");
|
Debug.Log("You won!");
|
||||||
}
|
}
|
||||||
|
@ -21,23 +21,23 @@ public class HpBar : MonoBehaviour
|
|||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (health.currentHealth == 4)
|
if (health.currentHealth <= 4)
|
||||||
{
|
{
|
||||||
heart5.sprite = brokenHeart;
|
heart5.sprite = brokenHeart;
|
||||||
}
|
}
|
||||||
if (health.currentHealth == 3)
|
if (health.currentHealth <= 3)
|
||||||
{
|
{
|
||||||
heart4.sprite = brokenHeart;
|
heart4.sprite = brokenHeart;
|
||||||
}
|
}
|
||||||
if (health.currentHealth == 2)
|
if (health.currentHealth <= 2)
|
||||||
{
|
{
|
||||||
heart3.sprite = brokenHeart;
|
heart3.sprite = brokenHeart;
|
||||||
}
|
}
|
||||||
if (health.currentHealth == 1)
|
if (health.currentHealth <= 1)
|
||||||
{
|
{
|
||||||
heart2.sprite = brokenHeart;
|
heart2.sprite = brokenHeart;
|
||||||
}
|
}
|
||||||
if (health.currentHealth == 0)
|
if (health.currentHealth <= 0)
|
||||||
{
|
{
|
||||||
heart1.sprite = brokenHeart;
|
heart1.sprite = brokenHeart;
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,18 @@ public class PlayerHealth : MonoBehaviour
|
|||||||
public GameObject deathEffect;
|
public GameObject deathEffect;
|
||||||
private SpriteRenderer playerSprite;
|
private SpriteRenderer playerSprite;
|
||||||
public Collider2D playerTrigger;
|
public Collider2D playerTrigger;
|
||||||
|
private PlayerScore score;
|
||||||
|
public GameObject count;
|
||||||
|
public int highscore;
|
||||||
|
public int deaths;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
currentHealth = maxHealth;
|
currentHealth = maxHealth;
|
||||||
playerSprite = this.GetComponent<SpriteRenderer>();
|
playerSprite = this.GetComponent<SpriteRenderer>();
|
||||||
|
score = count.GetComponent<PlayerScore>();
|
||||||
|
highscore = 0;
|
||||||
|
deaths = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTriggerEnter2D(Collider2D other)
|
void OnTriggerEnter2D(Collider2D other)
|
||||||
@ -52,7 +59,7 @@ public class PlayerHealth : MonoBehaviour
|
|||||||
{
|
{
|
||||||
currentHealth -= 1;
|
currentHealth -= 1;
|
||||||
Debug.Log("Health decreased");
|
Debug.Log("Health decreased");
|
||||||
if (currentHealth <= 0)
|
if (currentHealth == 0)
|
||||||
{
|
{
|
||||||
Die();
|
Die();
|
||||||
}
|
}
|
||||||
@ -62,6 +69,17 @@ public class PlayerHealth : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Instantiate(deathEffect, transform.position, Quaternion.identity);
|
Instantiate(deathEffect, transform.position, Quaternion.identity);
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
|
|
||||||
|
highscore = PlayerPrefs.GetInt("Kills") + score.killedEnemy;
|
||||||
|
PlayerPrefs.SetInt("Kills", highscore);
|
||||||
|
Debug.Log(PlayerPrefs.GetInt("Kills").ToString());
|
||||||
|
|
||||||
|
deaths++;
|
||||||
|
deaths = PlayerPrefs.GetInt("Deaths") + deaths;
|
||||||
|
PlayerPrefs.SetInt("Deaths", deaths);
|
||||||
|
Debug.Log(PlayerPrefs.GetInt("Deaths").ToString());
|
||||||
|
|
||||||
SceneManager.LoadScene("GameOver");
|
SceneManager.LoadScene("GameOver");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
Assets/Sprites/Board.png
Normal file
BIN
Assets/Sprites/Board.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 251 B |
152
Assets/Sprites/Board.png.meta
Normal file
152
Assets/Sprites/Board.png.meta
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fb4ae6d888eef8745922ccceadaccee4
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable:
|
||||||
|
- first:
|
||||||
|
213: 7841750413799554831
|
||||||
|
second: Board_0
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 2
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 16
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Android
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: WebGL
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites:
|
||||||
|
- serializedVersion: 2
|
||||||
|
name: Board_0
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 7
|
||||||
|
y: 7
|
||||||
|
width: 17
|
||||||
|
height: 14
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0, y: 0}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: f0f7bc7347e73dc60800000000000000
|
||||||
|
internalID: 7841750413799554831
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -20,4 +20,7 @@ EditorBuildSettings:
|
|||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/WinScene.unity
|
path: Assets/Scenes/WinScene.unity
|
||||||
guid: 03432555cb0e04a45bdf2456d296b553
|
guid: 03432555cb0e04a45bdf2456d296b553
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/Scenes/AgainScene.unity
|
||||||
|
guid: 63470b932abfcd242b22890a0750954d
|
||||||
m_configObjects: {}
|
m_configObjects: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user