You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We now define how the state of the game can change over time. This state-transition is done with the function `update : Msg -> Game -> Game`. This function will receive our `Msg` and will update the game-state accordingly. We distinguish here between `KeyboardExtraMsg` and `Step`:
31
+
We now define how the state of the game can change over time. This state-transition is done with the function `update : Msg -> Game -> Game`. This function will receive our `Msg` and will update the gamestate accordingly. We distinguish here between `KeyboardExtraMsg` and `Step`:
Copy file name to clipboardExpand all lines: doc/enemies.adoc
+6-7
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,13 @@ Enemies
3
3
4
4
image:Bildschirmfoto 2016-06-26 um 15.31.42.png[alt=""]
5
5
6
-
In the original game the shape of the "enemies" are defined in a large class and they are created in waves. For this tutorial we keep it simpler. We have some pre-defined enemy-arrangements that repeat themselves.
6
+
In the original game the shape of the "enemies" is defined in a large class and they are created in waves. For this tutorial we keep it simpler. We have some predefined enemyarrangements that repeat themselves.
This function returns a `Form` that contains a group of these trapezoids. Notice how we filter out parts by creating a tuple of `(index:Int, part:Bool)`, removing parts where part is `False` and sending the index to `makeEnemyPart`. Pure functional magic:
82
81
@@ -86,7 +85,7 @@ The following function `makeEnemies` will create a `List(Form)` for every enemy:
Copy file name to clipboardExpand all lines: doc/gameloop.adoc
+7-4
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
Game Loop and Debugger
2
2
----------------------
3
3
4
-
In this chapter we introduce a progress in the form of miliseconds that have passed since start. This progress is used to calculate the rotations and the movement of the enemies and also represents the "score" of the player.
4
+
In this chapter we introduce a progress counter in the form of miliseconds that have passed since the start of the game.
5
+
This progress is used to calculate the rotations and the movement of the enemies and also represents the "score" of the player.
5
6
6
-
We further extend the controls by a `Play`/`Pause`-behavior triggered by the space-key. For that we introduce a new type `State`:
7
+
We further extend the controls by a `Play`/`Pause`-behavior triggered by the spacekey. For that we introduce a new type `State`:
0 commit comments