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,
|
||||
type: 2}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 65.89836
|
||||
value: 63.233368
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 224150154901314796, guid: 460d856ea4eb14cedb5fecde1fe6d743,
|
||||
type: 2}
|
||||
|
|
|
@ -55,6 +55,6 @@ public class Player : Mob {
|
|||
protected override void Death() {
|
||||
Debug.Log("Player died...");
|
||||
Destroy(this.gameObject);
|
||||
GameController.instance.ChangeState(GameController.GameState.ENDED);
|
||||
GameController.instance.EndGame(GameController.EndedCause.DIED);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,6 +301,7 @@ public class GameController : MonoBehaviour {
|
|||
ui.GetComponent<UIController>().ShowGameOverUI();
|
||||
} else if(endCause == EndedCause.WIN) {
|
||||
//cam.GetComponent<AudioControl>().SfxPlay(2);
|
||||
player.InflictDamage(int.MaxValue/2);
|
||||
ui.GetComponent<UIController>().ShowWinUI();
|
||||
}
|
||||
} else {
|
||||
|
@ -325,6 +326,8 @@ public class GameController : MonoBehaviour {
|
|||
}
|
||||
|
||||
public void EndGame(EndedCause cause) {
|
||||
if (endCause != null && state == GameState.ENDED)
|
||||
return; // Already ended game
|
||||
endCause = cause;
|
||||
ChangeState(GameState.ENDED);
|
||||
}
|
||||
|
|
|
@ -432,7 +432,7 @@ public class DungeonGenerator {
|
|||
r.tiles[pos].type = Room.TileType.ROCK;
|
||||
continue;
|
||||
}
|
||||
float prob2 = 0.02f;
|
||||
float prob2 = 0.04f;
|
||||
if (UnityEngine.Random.value > 1 - prob2)
|
||||
{
|
||||
r.spawnpoints.Add(pos);
|
||||
|
|
|
@ -57,11 +57,20 @@ public class PlayerMovement : MonoBehaviour {
|
|||
//Debug.Log(br);
|
||||
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);
|
||||
if ( Input.GetAxis("Horizontal") > 0 )
|
||||
if (Input.GetAxis("Horizontal") < 0)
|
||||
{
|
||||
//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);
|
||||
// Debug lines
|
||||
Debug.DrawLine(transform.position, transform.position + speedVec, Color.magenta, 0.01f, false);
|
||||
|
|
Loading…
Add table
Reference in a new issue