Changes
Page history
Update Night of Horror
authored
Nov 25, 2024
by
Hong, Xin
Show whitespace changes
Inline
Side-by-side
home.md
View page @
069fe333
---
title
:
Night of Horror
---
# Game Design Document
[TOC]
...
...
@@ -299,3 +300,54 @@ 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.
# Coding
## State Machine
'''
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();
}
}
}
'''