Skip to content

Player should keep direction when horizontal speed is zero #241

@ForNeVeR

Description

@ForNeVeR

Consider that a player has an ability to turn. For easier reproduction, here's a patch that allows this from the start:

Index: O21.Game/Engine/Entities.fs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/O21.Game/Engine/Entities.fs b/O21.Game/Engine/Entities.fs
--- a/O21.Game/Engine/Entities.fs	(revision Staged)
+++ b/O21.Game/Engine/Entities.fs	(date 1746995143324)
@@ -115,7 +115,7 @@
             Direction = Right
             Lives = GameRules.InitialPlayerLives
             Score = 0
-            Abilities = Array.empty
+            Abilities = [| { Type = AbilityType.AllowTurn; Lifetime = 0 } |]
             Oxygen = OxygenStorage.Default
         }
 and OxygenStorage = {

Now, the player presses keys Left, Right.

In the original, this leads to horizontal speed of zero but still left-turning position,

In O21 currently, it leads to right-turning position (the default one).

It should keep the player sprite to face left.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions