Repository navigation
feat: generic gameplay components and systems for the example games - #37
Merged
Exeloo merged 1 commit intoNov 21, 2026
Merged
Conversation
MartinFillon
approved these changes
Nov 21, 2026
Exeloo
deleted the
feat/common-component-systems-needed-by-our-examples-games
branch
November 21, 2026 21:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Tag(several words),Model(templates copied by spawners),Lifetime+expireLifetimes,Follow2D+follow2D.WalkAndJump2D+walkAndJump2D(walk, jump, coyote time,buffering),
ChaseNearest2D,DeflectOnHit2D(paddle-style bounce angle),Bounds2D, bounces.Camera2D,Hud2D, sprite and move animations,FaceVelocity2D,FaceTarget2D,FadeOut2D,ScrollLoop2D, image crop and repeat.KeyboardControls2D,GamepadControls2D,Clickable2D,ColorOnHover2D,Draggable2D,FollowMouse2D.Shoot2D(fired by a player, a turret or the server, bullets from a model),ShootAtNearest2D,FaceAim2D,DamageOnHit2D,HealthBar2D.Collectible2D,AddToVarOnEnter2D),network-2d (server-to-client sync, catch-up on join), audio (sounds, music, mute keys).
test/recipes.spec.tsfor end-to-end recipes.Breaking changes
libDependencies^3.0.0).MoveController2D/moveControl2DandJumpController2D/jumpControl2Dremoved:use
KeyboardControls2DorGamepadControls2DwithWalkAndJump2D(strengthis nowjumpHeight).ShootController2D/shootControl2Dremoved: useShoot2D(reloadTimebecomesfireRate,bulletLifetimebecomesrange), a bullet model andKeyboardControls2D.DamageDealerbecomesDamageOnHit2D, which hitshitRatetimes a second while touching.applyDamage2Dtakesctx.Ownerhas no constructor parameter. A shooter's own bullets neverhit it.
DrawableRect2Dturns around its center by default (rotateAroundCenter), anddraw2DdrawsHud2Dentities on their own layer.blockOnStaticBodies2Dalso blocks walkers and circles, bounces, and pushes a boxback to the side it came from.