... | @@ -5,6 +5,7 @@ title: Night of Horror |
... | @@ -5,6 +5,7 @@ title: Night of Horror |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Toc]
|
|
[Toc]
|
|
# Game Design Document
|
|
# Game Design Document
|
|
|
|
|
... | @@ -205,7 +206,6 @@ private void Move() |
... | @@ -205,7 +206,6 @@ private void Move() |
|
* State switching logic
|
|
* State switching logic
|
|
+ During the patrol, the monster will constantly detect whether the player has entered its detection range (determined by distance and angle). If the player enters the range, the current monster will switch to the pursuit state. Under certain conditions (the player obtains the crystal), all monsters switch to the pursuit state.
|
|
+ During the patrol, the monster will constantly detect whether the player has entered its detection range (determined by distance and angle). If the player enters the range, the current monster will switch to the pursuit state. Under certain conditions (the player obtains the crystal), all monsters switch to the pursuit state.
|
|
+ Keycode
|
|
+ Keycode
|
|
* Monster generation and patrol target initialization
|
|
|
|
```csharp
|
|
```csharp
|
|
private void InitialiseSpawnPoints()
|
|
private void InitialiseSpawnPoints()
|
|
{
|
|
{
|
... | @@ -239,7 +239,6 @@ public Vector3 GetRandomSpawnLocation() |
... | @@ -239,7 +239,6 @@ public Vector3 GetRandomSpawnLocation() |
|
return spawnTransform.position;
|
|
return spawnTransform.position;
|
|
}
|
|
}
|
|
```
|
|
```
|
|
* Patrol logic implementation
|
|
|
|
```csharp
|
|
```csharp
|
|
private void Patrol()
|
|
private void Patrol()
|
|
{
|
|
{
|
... | @@ -267,7 +266,6 @@ private void SetNewPatrolTarget() |
... | @@ -267,7 +266,6 @@ private void SetNewPatrolTarget() |
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
```
|
|
* State switching
|
|
|
|
```csharp
|
|
```csharp
|
|
private bool DetectPlayer()
|
|
private bool DetectPlayer()
|
|
{
|
|
{
|
... | @@ -314,7 +312,6 @@ public void ActivateGlobalChase() |
... | @@ -314,7 +312,6 @@ public void ActivateGlobalChase() |
|
* When the monster approaches the player and reaches the capture distance, the capture logic is triggered.
|
|
* When the monster approaches the player and reaches the capture distance, the capture logic is triggered.
|
|
* The game ends after the player is captured.
|
|
* The game ends after the player is captured.
|
|
* Keycode
|
|
* Keycode
|
|
+ Normal pursuit
|
|
|
|
```csharp
|
|
```csharp
|
|
private void Pursuit()
|
|
private void Pursuit()
|
|
{
|
|
{
|
... | @@ -389,8 +386,6 @@ private bool PlayerInChaseRange() |
... | @@ -389,8 +386,6 @@ private bool PlayerInChaseRange() |
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
+ Global pursuit
|
|
|
|
```csharp
|
|
```csharp
|
|
private void Pursuit()
|
|
private void Pursuit()
|
|
{
|
|
{
|
... | | ... | |