Update Night of Horror authored by Hong, Xin's avatar Hong, Xin
---
title: Night of Horror
---
[Toc]
# Game Design Document
[TOC]
## Introduction
......@@ -307,56 +299,3 @@ title: Night of Horror
* Expand game content, and improve playability and diversity.
+ Specific implementation:
* Design unique levels on different floors, and add new puzzles, monster behaviors, or scene changes on each floor to bring fresh experiences to players.
\ No newline at end of file
# Coding
## State Machine
```csharp
public interface IState
{
public void Enter();
public void Exit();
public void Update();
public void PhysicsUpdate();
}
~~~
public abstract class StateMachine
{
protected IState currentState;
public void ChangeState(IState newState)
{
//currentState?.Exit();
if (currentState != null)
{
currentState.Exit();
}
currentState = newState;
currentState.Enter();
}
public void Update()
{
if (currentState != null)
{
currentState.Update();
}
}
public void PhysicsUpdate()
{
if (currentState != null)
{
currentState.PhysicsUpdate();
}
}
}
~~~
\ No newline at end of file