Merge remote-tracking branch 'origin/PiegamesDev' into PiegamesDev
This commit is contained in:
commit
5ff812cbcd
5 changed files with 20 additions and 8 deletions
|
@ -976,7 +976,7 @@ Prefab:
|
||||||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||||
type: 2}
|
type: 2}
|
||||||
propertyPath: m_AnchoredPosition.x
|
propertyPath: m_AnchoredPosition.x
|
||||||
value: 65.89836
|
value: 63.233368
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||||
type: 2}
|
type: 2}
|
||||||
|
|
|
@ -55,6 +55,6 @@ public class Player : Mob {
|
||||||
protected override void Death() {
|
protected override void Death() {
|
||||||
Debug.Log("Player died...");
|
Debug.Log("Player died...");
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
GameController.instance.ChangeState(GameController.GameState.ENDED);
|
GameController.instance.EndGame(GameController.EndedCause.DIED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,8 @@ public class GameController : MonoBehaviour {
|
||||||
cam.GetComponent<AudioControl>().GameOverBgm();
|
cam.GetComponent<AudioControl>().GameOverBgm();
|
||||||
ui.GetComponent<UIController>().ShowGameOverUI();
|
ui.GetComponent<UIController>().ShowGameOverUI();
|
||||||
} else if(endCause == EndedCause.WIN) {
|
} else if(endCause == EndedCause.WIN) {
|
||||||
//cam.GetComponent<AudioControl>().SfxPlay(2);
|
//cam.GetComponent<AudioControl>().SfxPlay(2);
|
||||||
|
player.InflictDamage(int.MaxValue/2);
|
||||||
ui.GetComponent<UIController>().ShowWinUI();
|
ui.GetComponent<UIController>().ShowWinUI();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -325,6 +326,8 @@ public class GameController : MonoBehaviour {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EndGame(EndedCause cause) {
|
public void EndGame(EndedCause cause) {
|
||||||
|
if (endCause != null && state == GameState.ENDED)
|
||||||
|
return; // Already ended game
|
||||||
endCause = cause;
|
endCause = cause;
|
||||||
ChangeState(GameState.ENDED);
|
ChangeState(GameState.ENDED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,7 +432,7 @@ public class DungeonGenerator {
|
||||||
r.tiles[pos].type = Room.TileType.ROCK;
|
r.tiles[pos].type = Room.TileType.ROCK;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
float prob2 = 0.02f;
|
float prob2 = 0.04f;
|
||||||
if (UnityEngine.Random.value > 1 - prob2)
|
if (UnityEngine.Random.value > 1 - prob2)
|
||||||
{
|
{
|
||||||
r.spawnpoints.Add(pos);
|
r.spawnpoints.Add(pos);
|
||||||
|
|
|
@ -57,11 +57,20 @@ public class PlayerMovement : MonoBehaviour {
|
||||||
//Debug.Log(br);
|
//Debug.Log(br);
|
||||||
Debug.DrawLine(transform.position, transform.position + br, Color.red, 0.01f, false);
|
Debug.DrawLine(transform.position, transform.position + br, Color.red, 0.01f, false);
|
||||||
}
|
}
|
||||||
if ( Input.GetAxis("Horizontal") < 0 )
|
|
||||||
rb.MoveRotation(rb.rotation + turnSpeed);
|
|
||||||
//transform.Rotate(Vector3.forward * turnSpeed);
|
//transform.Rotate(Vector3.forward * turnSpeed);
|
||||||
if ( Input.GetAxis("Horizontal") > 0 )
|
if (Input.GetAxis("Horizontal") < 0)
|
||||||
rb.MoveRotation(rb.rotation - turnSpeed);
|
{
|
||||||
|
//rb.rotation += turnSpeed;
|
||||||
|
rb.MoveRotation(rb.rotation + turnSpeed);
|
||||||
|
} else
|
||||||
|
//transform.Rotate(Vector3.forward * turnSpeed);
|
||||||
|
if (Input.GetAxis("Horizontal") > 0)
|
||||||
|
{
|
||||||
|
//rb.rotation -= turnSpeed;
|
||||||
|
rb.MoveRotation(rb.rotation - turnSpeed);
|
||||||
|
} else {
|
||||||
|
rb.MoveRotation(rb.rotation);
|
||||||
|
}
|
||||||
//transform.Rotate(Vector3.forward * -turnSpeed);
|
//transform.Rotate(Vector3.forward * -turnSpeed);
|
||||||
// Debug lines
|
// Debug lines
|
||||||
Debug.DrawLine(transform.position, transform.position + speedVec, Color.magenta, 0.01f, false);
|
Debug.DrawLine(transform.position, transform.position + speedVec, Color.magenta, 0.01f, false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue