Skip to content

feat: generic gameplay components and systems for the example games - #37

Merged
Exeloo merged 1 commit into
mainfrom
feat/common-component-systems-needed-by-our-examples-games
Nov 21, 2026
Merged

Exeloo merged 1 commit into
mainfrom
feat/common-component-systems-needed-by-our-examples-games

Conversation

@Tchips46

Copy link
Copy Markdown
Member

Adds the components and systems the NanoForge-dev/examples games share, as generic items: one
responsibility each, shared logic driven by simple fields that a keyboard, an AI or the server can
fill, and defaults that show something with 2-3 components.

New

  • basics-2d: Tag (several words), Model (templates copied by spawners), Lifetime +
    expireLifetimes, Follow2D + follow2D.
  • physics-2d: hitbox offsets, WalkAndJump2D + walkAndJump2D (walk, jump, coyote time,
    buffering), ChaseNearest2D, DeflectOnHit2D (paddle-style bounce angle), Bounds2D, bounces.
  • graphics-2d: Camera2D, Hud2D, sprite and move animations, FaceVelocity2D,
    FaceTarget2D, FadeOut2D, ScrollLoop2D, image crop and repeat.
  • controls-2d: KeyboardControls2D, GamepadControls2D, Clickable2D, ColorOnHover2D,
    Draggable2D, FollowMouse2D.
  • combat-2d: Shoot2D (fired by a player, a turret or the server, bullets from a model),
    ShootAtNearest2D, FaceAim2D, DamageOnHit2D, HealthBar2D.
  • New packages: scenes-2d (scene vars in texts, Collectible2D, AddToVarOnEnter2D),
    network-2d (server-to-client sync, catch-up on join), audio (sounds, music, mute keys).
  • Tests split per package, plus test/recipes.spec.ts for end-to-end recipes.

Breaking changes

  • All packages now need Engine v3 (libDependencies ^3.0.0).
  • controls-2d: MoveController2D/moveControl2D and JumpController2D/jumpControl2D removed:
    use KeyboardControls2D or GamepadControls2D with WalkAndJump2D (strength is now
    jumpHeight).
  • combat-2d: ShootController2D/shootControl2D removed: use Shoot2D (reloadTime becomes
    fireRate, bulletLifetime becomes range), a bullet model and KeyboardControls2D.
    DamageDealer becomes DamageOnHit2D, which hits hitRate times a second while touching.
    applyDamage2D takes ctx. Owner has no constructor parameter. A shooter's own bullets never
    hit it.
  • graphics-2d: DrawableRect2D turns around its center by default (rotateAroundCenter), and
    draw2D draws Hud2D entities on their own layer.
  • physics-2d: blockOnStaticBodies2D also blocks walkers and circles, bounces, and pushes a box
    back to the side it came from.

@Tchips46 Tchips46 self-assigned this Nov 21, 2026
@Exeloo
Exeloo merged commit 2788707 into main Nov 21, 2026
10 of 12 checks passed
@Exeloo
Exeloo deleted the feat/common-component-systems-needed-by-our-examples-games branch November 21, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants