summaryrefslogtreecommitdiff
path: root/presentatie/presentatie.md
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2021-08-04 20:16:53 +0200
committerMike Vink <mike1994vink@gmail.com>2021-08-04 20:16:53 +0200
commit74c86dc13485a4781092cdb2e9f682f0c14f97c7 (patch)
tree670efe69f868b8e31bfa92065102f979e84a8a1a /presentatie/presentatie.md
parentba6e5201d3eea1a0a36f685d4e1a5f57fcefe199 (diff)
feat(presentatie): speler beweeg algoritme
Diffstat (limited to 'presentatie/presentatie.md')
-rw-r--r--presentatie/presentatie.md219
1 files changed, 218 insertions, 1 deletions
diff --git a/presentatie/presentatie.md b/presentatie/presentatie.md
index f641a5c..286f977 100644
--- a/presentatie/presentatie.md
+++ b/presentatie/presentatie.md
@@ -341,4 +341,221 @@ class Bart ...
# Het actor systeem van akkamon: spelers laten bewegen in de wereld
-![test](./test.gif)
+![5](./lopenShort.gif)
+
+* TrainerID, Direction enum en TilePos data
+
+```java
+ class TrainerID { enum Direction { class TilePos {
+ String id; UP, int x;
+ String scene; DOWN, int y;
+ } LEFT, }
+ RIGHT,
+ NONE
+ }
+```
+
+* Movement voor een actor berichten
+
+```java
+ class RequestStartMoving { class RequestStopMoving { class RequestNewTilePos {
+ long requestId; ...same as start long requestId;
+ TrainerID trainerID; } TrainerID trainerID;
+ Direction direction; TilePos tilePos;
+ ActorRef<AkkamonNexus.Command> replyTo; ActorRef<AkkamonNexus.Command> replyTo;
+ } }
+```
+
+> Naar welke actor gaan deze berichten?
+
+---
+
+# Hoe gaan we van Direction input naar spelers bewegen? Direction Queue's sturen met HeartBeats
+
+* Start timer voor 200ms, als de tijd voorbij is dan vraag je om een HeartBeat
+
+```
+ ┌─────┐
+ │Nexus│
+ └─────┘
+ / |
+ . . <- Map<sceneId, actor>
+ | |
+ ┌─────┐
+ │Scene│ ...
+ └─────┘
+ / |
+ . . <- Map<TrainerID, actor>
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+```
+
+---
+
+```
+ speler begint naar boven te bewegen
+
+ |
+ |
+ \|/
+ .
+ tell(StartMovingRequest)
+ |
+ \|/
+ .
+ ┌─────┐
+ │Nexus│
+ └─────┘
+ / |
+ . .
+ | |
+ ┌─────┐
+ │Scene│ ...
+ └─────┘
+ / |
+ . .
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+```
+
+---
+
+```
+ ┌─────┐
+ │Nexus│
+ └─────┘
+ / |
+ . .
+ | |
+ ┌─────┐
+ │Scene│ ...
+ └─────┘
+ / |
+ Direction.UP . .
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+```
+
+---
+
+
+```
+ speler bereikt een nieuwe TilePos
+
+ |
+ |
+ \|/
+ .
+ tell(NewTilePosRequest)
+ |
+ \|/
+ .
+ ┌─────┐
+ │Nexus│
+ └─────┘
+ / |
+ . .
+ | |
+ ┌─────┐
+ │Scene│ ...
+ └─────┘
+ / |
+ Direction.UP . .
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+```
+
+---
+
+
+```
+ ┌─────┐
+ │Nexus│
+ └─────┘
+ / |
+ . .
+ | |
+ ┌─────┐
+ │Scene│ ...
+ └─────┘
+ Direction.UP / |
+ Direction.UP . .
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+```
+
+---
+
+# 200ms zijn voorbij
+
+```
+ Automatische timer
+
+ |
+ |
+ \|/
+ .
+ tell(HeartBeatRequest)
+ |
+ \|/
+ .
+ ┌─────┐<---. ┌─────┐
+ │Query│ \ │Nexus│
+ └─────┘ .spawn └─────┘
+ (Query) / |
+ \ . .
+ \ | |
+ ┌─────┐
+ │Scene│ ...
+ └─────┘
+ Direction.UP / |
+ Direction.UP . .
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+```
+
+---
+
+```
+
+ Verzend naar spelers en speel de moves af
+ .
+ /|\
+ |
+ |
+ ┌─────┐ ┌─────┐
+ │Query│-tell(HeartBeat)->│Nexus│
+ └─────┘ Response └─────┘
+ | / |
+ | . .
+ Direction.UP | |
+ Direction.UP ┌─────┐
+ . │Scene│ ...
+ /|\ └─────┘
+ | / |
+ | . .
+ ┌─────────┐ | |
+ │MoveQueue│┌──────────┐
+ └─────────┘ Trainer │ ...
+ └─────────────────────┘
+
+```
+
+---
+
+# "Stap2": twee spelers een interactie laten aangaan met een handshake actor
+
+* Als twee spelers een interactie aangaan moeten ze eerst allebei accepteren
+