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 @
f31ef7b3
---
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