Archery

In this game, the player controls an archer who must shoot arrows at targets. The player can move left and right using the arrow keys, and can shoot arrows by pressing the space bar. The target will move back and forth across the screen, and the player must time their shots to hit the target. The game will keep track of the player’s score, which increases each time they hit the target. The game ends when the player reaches 30 points.

flowchart TD

    A[Game Starts] --> B[Explore Map]

    B --> C{Interact w/ Villager NPC?}

    C -->|No| B
    C -->|Yes| D[NPC Asks to Start Game]

    D --> E{Player Choice}

    E -->|Nevermind| B
    E -->|Start| F[Remove Barrier, Start Target Movement, Destroy NPC, Enable Player Attacks]

    F --> G{Player Presses Space?}

    G --> |True| H{Spawn Arrow}
    G --> |False| I
    
    H --> I{Arrow Obj Exists?}

    I --> |True| J[Move arrow up screen]
    J --> K{Arrow hits target?}
    K --> |True| L[Arrow sticks to target, hits remaining decreases by 1]

    L --> M{Hits remaining <= 0?}
    M --> |True| N[Show end screen, stop game]
    
    M --> |False| O{Arrow is offscreen?}

    O --> |True| P[Destroy Arrow]
    O --> |False| Q[Draw all]
    P --> Q

    Q --> G

Fortress

Description: Placeholder

flowchart TD

A[Game Engine loads GameLevelFortress] --> B[Constructor runs]

B --> C[Initialize gameEnv reference]
C --> D[Setup scytheSpawnTimer & scytheSpawnInterval]
D --> E[Load level music]
E --> F[Define background, player, NPC, barrier data]

F --> G[Create game object classes]
G --> H[GameEnvBackground]
G --> I[Player]
G --> J[Npc]
G --> K[Barrier]

H --> L[Objects instantiated in game environment]
I --> L
J --> L
K --> L

L --> M[Game Loop begins]

M --> N[GameLevelFortress.update called every frame]

N --> O[Increment scytheSpawnTimer]

O --> P{Timer >= scytheSpawnInterval?}

P -- No --> M

P -- Yes --> Q[Generate 1–10 scythes randomly]

Q --> R[spawnScythe]

R --> S[Create new Scythe]

S --> T[Add scythe to gameEnv.gameObjects]
T --> U[Append scythe.canvas to DOM container]

U --> V[Scythe.update runs every frame]

V --> W[Check NPC collision]

W --> X{Hit NPC?}

X -- Yes --> Y[Set _hittingNPC = true & Scythe stops moving]

X -- No --> Z[Move along elliptical arc path]

Z --> AA{Path completed?}

AA -- Yes --> AB[Destroy scythe & Remove from gameObjects & Remove canvas]

AA -- No --> AC[Rotate scythe sprite]

AC --> AD[Check player collision]

AD --> AE{Player hit?}

AE -- Yes --> AF[Destroy scythe & Call showEndScreen]

AE -- No --> V