@nayan-ui/games 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -191
- package/lib/module/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/lib/module/assets/models/explorer/explorer.glb +0 -0
- package/lib/module/assets/models/explorer/params.json +51 -0
- package/lib/module/assets/models/explorer/source.json +222 -0
- package/lib/module/assets/models/play-with-tua/play-with-tua.glb +0 -0
- package/lib/module/assets/models/play-with-tua/sources.json +141 -0
- package/lib/module/assets/sfx/balloon_pop.wav +0 -0
- package/lib/module/assets/sfx/blocked.wav +0 -0
- package/lib/module/assets/sfx/boing.wav +0 -0
- package/lib/module/assets/sfx/bonus.wav +0 -0
- package/lib/module/assets/sfx/boom.wav +0 -0
- package/lib/module/assets/sfx/bump.wav +0 -0
- package/lib/module/assets/sfx/cannon.wav +0 -0
- package/lib/module/assets/sfx/capture.wav +0 -0
- package/lib/module/assets/sfx/card_flip.wav +0 -0
- package/lib/module/assets/sfx/card_place.wav +0 -0
- package/lib/module/assets/sfx/catch.wav +0 -0
- package/lib/module/assets/sfx/chime.wav +0 -0
- package/lib/module/assets/sfx/chomp.wav +0 -0
- package/lib/module/assets/sfx/chomp_alt.wav +0 -0
- package/lib/module/assets/sfx/clack.wav +0 -0
- package/lib/module/assets/sfx/clang.wav +0 -0
- package/lib/module/assets/sfx/clash.wav +0 -0
- package/lib/module/assets/sfx/click.wav +0 -0
- package/lib/module/assets/sfx/coin.wav +0 -0
- package/lib/module/assets/sfx/combo.wav +0 -0
- package/lib/module/assets/sfx/crash.wav +0 -0
- package/lib/module/assets/sfx/crunch.wav +0 -0
- package/lib/module/assets/sfx/dance.wav +0 -0
- package/lib/module/assets/sfx/deselect.wav +0 -0
- package/lib/module/assets/sfx/dice_roll.wav +0 -0
- package/lib/module/assets/sfx/die.wav +0 -0
- package/lib/module/assets/sfx/draw.wav +0 -0
- package/lib/module/assets/sfx/drop.wav +0 -0
- package/lib/module/assets/sfx/eat.wav +0 -0
- package/lib/module/assets/sfx/engine.wav +0 -0
- package/lib/module/assets/sfx/error.wav +0 -0
- package/lib/module/assets/sfx/flag.wav +0 -0
- package/lib/module/assets/sfx/flap.wav +0 -0
- package/lib/module/assets/sfx/flip_disc.wav +0 -0
- package/lib/module/assets/sfx/footstep_run.wav +0 -0
- package/lib/module/assets/sfx/footstep_walk.wav +0 -0
- package/lib/module/assets/sfx/game_over.wav +0 -0
- package/lib/module/assets/sfx/gate.wav +0 -0
- package/lib/module/assets/sfx/hit.wav +0 -0
- package/lib/module/assets/sfx/hop.wav +0 -0
- package/lib/module/assets/sfx/hurt.wav +0 -0
- package/lib/module/assets/sfx/invalid.wav +0 -0
- package/lib/module/assets/sfx/jump.wav +0 -0
- package/lib/module/assets/sfx/ladder.wav +0 -0
- package/lib/module/assets/sfx/land.wav +0 -0
- package/lib/module/assets/sfx/laugh.wav +0 -0
- package/lib/module/assets/sfx/lose.wav +0 -0
- package/lib/module/assets/sfx/merge.wav +0 -0
- package/lib/module/assets/sfx/miss.wav +0 -0
- package/lib/module/assets/sfx/nitro.wav +0 -0
- package/lib/module/assets/sfx/pew.wav +0 -0
- package/lib/module/assets/sfx/place.wav +0 -0
- package/lib/module/assets/sfx/pling.wav +0 -0
- package/lib/module/assets/sfx/point.wav +0 -0
- package/lib/module/assets/sfx/pop.wav +0 -0
- package/lib/module/assets/sfx/pop_soft.wav +0 -0
- package/lib/module/assets/sfx/power_up.wav +0 -0
- package/lib/module/assets/sfx/reveal.wav +0 -0
- package/lib/module/assets/sfx/robot.wav +0 -0
- package/lib/module/assets/sfx/rotate.wav +0 -0
- package/lib/module/assets/sfx/run_steps.wav +0 -0
- package/lib/module/assets/sfx/select.wav +0 -0
- package/lib/module/assets/sfx/shuffle.wav +0 -0
- package/lib/module/assets/sfx/six.wav +0 -0
- package/lib/module/assets/sfx/slice.wav +0 -0
- package/lib/module/assets/sfx/slide.wav +0 -0
- package/lib/module/assets/sfx/snake.wav +0 -0
- package/lib/module/assets/sfx/snap.wav +0 -0
- package/lib/module/assets/sfx/splash.wav +0 -0
- package/lib/module/assets/sfx/star.wav +0 -0
- package/lib/module/assets/sfx/start.wav +0 -0
- package/lib/module/assets/sfx/swoosh.wav +0 -0
- package/lib/module/assets/sfx/tap.wav +0 -0
- package/lib/module/assets/sfx/thud.wav +0 -0
- package/lib/module/assets/sfx/thunk.wav +0 -0
- package/lib/module/assets/sfx/tick.wav +0 -0
- package/lib/module/assets/sfx/time_up.wav +0 -0
- package/lib/module/assets/sfx/tock.wav +0 -0
- package/lib/module/assets/sfx/walk_steps.wav +0 -0
- package/lib/module/assets/sfx/warning.wav +0 -0
- package/lib/module/assets/sfx/whack.wav +0 -0
- package/lib/module/assets/sfx/whoosh.wav +0 -0
- package/lib/module/assets/sfx/win.wav +0 -0
- package/lib/module/assets/sfx/zap.wav +0 -0
- package/lib/module/assets/textures/ad_bolt.png +0 -0
- package/lib/module/assets/textures/ad_bubbles.png +0 -0
- package/lib/module/assets/textures/ad_chevrons.png +0 -0
- package/lib/module/assets/textures/asphalt.png +0 -0
- package/lib/module/assets/textures/bark.jpg +0 -0
- package/lib/module/assets/textures/explorer-atlas.png +0 -0
- package/lib/module/assets/textures/facade.png +0 -0
- package/lib/module/assets/textures/grass.png +0 -0
- package/lib/module/assets/textures/leaves.png +0 -0
- package/lib/module/assets/textures/limestone.jpg +0 -0
- package/lib/module/assets/textures/meadow.jpg +0 -0
- package/lib/module/assets/textures/nature-sources.json +87 -0
- package/lib/module/assets/textures/pine.png +0 -0
- package/lib/module/assets/textures/river.jpg +0 -0
- package/lib/module/assets/textures/soft_glow.png +0 -0
- package/lib/module/games/arrows/Arrows.js +1 -1
- package/lib/module/games/arrows/ArrowsConstants.js +1 -1
- package/lib/module/games/arrows/ArrowsGame.js +1 -0
- package/lib/module/games/arrows/ArrowsScene.js +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterGame.js +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterPhysics.js +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterScene.js +1 -0
- package/lib/module/games/bike-racing/BikeMeshes.js +1 -0
- package/lib/module/games/bike-racing/BikeRacing.js +1 -1
- package/lib/module/games/bike-racing/BikeRacingConstants.js +1 -1
- package/lib/module/games/bike-racing/BikeRacingGame.js +1 -0
- package/lib/module/games/bike-racing/BikeRacingScene.js +1 -0
- package/lib/module/games/block-blast/BlockBlast.js +1 -1
- package/lib/module/games/block-blast/BlockBlastConstants.js +1 -1
- package/lib/module/games/block-blast/BlockBlastGame.js +1 -0
- package/lib/module/games/block-blast/BlockBlastScene.js +1 -0
- package/lib/module/games/block-breaker/BlockBreaker.js +1 -1
- package/lib/module/games/block-breaker/BlockBreakerConstants.js +1 -1
- package/lib/module/games/block-breaker/BlockBreakerGame.js +1 -0
- package/lib/module/games/block-breaker/BlockBreakerScene.js +1 -0
- package/lib/module/games/bluk/Bluk.js +1 -1
- package/lib/module/games/bluk/BlukConstants.js +1 -1
- package/lib/module/games/bluk/BlukGame.js +1 -0
- package/lib/module/games/bluk/BlukRules.js +1 -0
- package/lib/module/games/bluk/BlukScene.js +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooter.js +1 -1
- package/lib/module/games/bubble-shooter/BubbleShooterConstants.js +1 -1
- package/lib/module/games/bubble-shooter/BubbleShooterGame.js +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterScene.js +1 -0
- package/lib/module/games/candy-crush/CandyCrush.js +1 -1
- package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -1
- package/lib/module/games/candy-crush/CandyCrushGame.js +1 -0
- package/lib/module/games/candy-crush/CandyCrushScene.js +1 -0
- package/lib/module/games/car-racing/CarMeshes.js +1 -0
- package/lib/module/games/car-racing/CarRacing.js +1 -1
- package/lib/module/games/car-racing/CarRacingConstants.js +1 -1
- package/lib/module/games/car-racing/CarRacingFacade.js +1 -0
- package/lib/module/games/car-racing/CarRacingGame.js +1 -0
- package/lib/module/games/car-racing/CarRacingScene.js +1 -0
- package/lib/module/games/car-racing/CarRacingScenery.js +1 -0
- package/lib/module/games/chameleon-run/ChameleonRun.js +1 -1
- package/lib/module/games/chameleon-run/ChameleonRunBackdrop.js +1 -0
- package/lib/module/games/chameleon-run/ChameleonRunConstants.js +1 -1
- package/lib/module/games/chameleon-run/ChameleonRunGame.js +1 -0
- package/lib/module/games/chameleon-run/ChameleonRunMeshes.js +1 -0
- package/lib/module/games/chameleon-run/ChameleonRunRules.js +1 -0
- package/lib/module/games/chameleon-run/ChameleonRunScene.js +1 -0
- package/lib/module/games/checkers/Checkers.js +1 -1
- package/lib/module/games/checkers/CheckersAI.js +1 -0
- package/lib/module/games/checkers/CheckersConstants.js +1 -1
- package/lib/module/games/checkers/CheckersGame.js +1 -0
- package/lib/module/games/checkers/CheckersRules.js +1 -0
- package/lib/module/games/checkers/CheckersScene.js +1 -0
- package/lib/module/games/color-switch/ColorSwitch.js +1 -1
- package/lib/module/games/color-switch/ColorSwitchConstants.js +1 -1
- package/lib/module/games/color-switch/ColorSwitchGame.js +1 -0
- package/lib/module/games/color-switch/ColorSwitchScene.js +1 -0
- package/lib/module/games/colors-sort/ColorsSort.js +1 -1
- package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -1
- package/lib/module/games/colors-sort/ColorsSortGame.js +1 -0
- package/lib/module/games/colors-sort/ColorsSortScene.js +1 -0
- package/lib/module/games/connect-em-all/ConnectEmAll.js +1 -1
- package/lib/module/games/connect-em-all/ConnectEmAllConstants.js +1 -1
- package/lib/module/games/connect-em-all/ConnectEmAllGame.js +1 -0
- package/lib/module/games/connect-em-all/ConnectEmAllScene.js +1 -0
- package/lib/module/games/crossy-road/CrossyRoad.js +1 -1
- package/lib/module/games/crossy-road/CrossyRoadCamera.js +1 -0
- package/lib/module/games/crossy-road/CrossyRoadConstants.js +1 -1
- package/lib/module/games/crossy-road/CrossyRoadGame.js +1 -0
- package/lib/module/games/crossy-road/CrossyRoadMeshes.js +1 -0
- package/lib/module/games/crossy-road/CrossyRoadPerson.js +1 -0
- package/lib/module/games/crossy-road/CrossyRoadRules.js +1 -0
- package/lib/module/games/crossy-road/CrossyRoadScene.js +1 -0
- package/lib/module/games/dino-jump/DinoJump.js +1 -1
- package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -1
- package/lib/module/games/dino-jump/DinoJumpGame.js +1 -0
- package/lib/module/games/dino-jump/DinoJumpScene.js +1 -0
- package/lib/module/games/dots-and-boxes/DotsAndBoxes.js +1 -1
- package/lib/module/games/dots-and-boxes/DotsAndBoxesConstants.js +1 -1
- package/lib/module/games/dots-and-boxes/DotsAndBoxesGame.js +1 -0
- package/lib/module/games/dots-and-boxes/DotsAndBoxesScene.js +1 -0
- package/lib/module/games/falling-sticks/FallingSticks.js +1 -1
- package/lib/module/games/falling-sticks/FallingSticksConstants.js +1 -1
- package/lib/module/games/falling-sticks/FallingSticksGame.js +1 -0
- package/lib/module/games/falling-sticks/FallingSticksRules.js +1 -0
- package/lib/module/games/falling-sticks/FallingSticksScene.js +1 -0
- package/lib/module/games/find-different-number/FindDifferentNumber.js +1 -1
- package/lib/module/games/find-different-number/FindDifferentNumberConstants.js +1 -1
- package/lib/module/games/find-different-number/FindDifferentNumberGame.js +1 -0
- package/lib/module/games/find-different-number/FindDifferentNumberRules.js +1 -0
- package/lib/module/games/find-different-number/FindDifferentNumberScene.js +1 -0
- package/lib/module/games/flappy-bird/FlappyBird.js +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdGame.js +1 -0
- package/lib/module/games/flappy-bird/FlappyBirdScene.js +1 -0
- package/lib/module/games/fruit-merger/FruitMerger.js +1 -1
- package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -1
- package/lib/module/games/fruit-merger/FruitMergerGame.js +1 -0
- package/lib/module/games/fruit-merger/FruitMergerRules.js +1 -0
- package/lib/module/games/fruit-merger/FruitMergerScene.js +1 -0
- package/lib/module/games/fruit-ninja/FruitNinja.js +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaGame.js +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaScene.js +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaWorld.js +1 -0
- package/lib/module/games/game-2048/Game2048.js +1 -1
- package/lib/module/games/game-2048/Game2048Constants.js +1 -1
- package/lib/module/games/game-2048/Game2048Game.js +1 -0
- package/lib/module/games/game-2048/Game2048Rules.js +1 -0
- package/lib/module/games/game-2048/Game2048Scene.js +1 -0
- package/lib/module/games/knife-hit/KnifeHit.js +1 -1
- package/lib/module/games/knife-hit/KnifeHitConstants.js +1 -1
- package/lib/module/games/knife-hit/KnifeHitGame.js +1 -0
- package/lib/module/games/knife-hit/KnifeHitScene.js +1 -0
- package/lib/module/games/ludo-king/LudoKing.js +1 -1
- package/lib/module/games/ludo-king/LudoKingConstants.js +1 -1
- package/lib/module/games/ludo-king/LudoKingGame.js +1 -0
- package/lib/module/games/ludo-king/LudoKingRules.js +1 -0
- package/lib/module/games/ludo-king/LudoKingScene.js +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -1
- package/lib/module/games/maze-runner/MazeRunnerGame.js +1 -0
- package/lib/module/games/maze-runner/MazeRunnerRules.js +1 -0
- package/lib/module/games/maze-runner/MazeRunnerScene.js +1 -0
- package/lib/module/games/memory-match/MemoryMatch.js +1 -1
- package/lib/module/games/memory-match/MemoryMatchConstants.js +1 -1
- package/lib/module/games/memory-match/MemoryMatchGame.js +1 -0
- package/lib/module/games/memory-match/MemoryMatchRules.js +1 -0
- package/lib/module/games/memory-match/MemoryMatchScene.js +1 -0
- package/lib/module/games/mine-sweeper/MineSweeper.js +1 -1
- package/lib/module/games/mine-sweeper/MineSweeperConstants.js +1 -1
- package/lib/module/games/mine-sweeper/MineSweeperGame.js +1 -0
- package/lib/module/games/mine-sweeper/MineSweeperRules.js +1 -0
- package/lib/module/games/mine-sweeper/MineSweeperScene.js +1 -0
- package/lib/module/games/mob-control/MobControl.js +1 -1
- package/lib/module/games/mob-control/MobControlConstants.js +1 -1
- package/lib/module/games/mob-control/MobControlGame.js +1 -0
- package/lib/module/games/mob-control/MobControlMeshes.js +1 -0
- package/lib/module/games/mob-control/MobControlRenderer.js +1 -0
- package/lib/module/games/mob-control/MobControlRules.js +1 -0
- package/lib/module/games/mob-control/MobControlScene.js +1 -0
- package/lib/module/games/number-search/NumberSearch.js +1 -1
- package/lib/module/games/number-search/NumberSearchNumbers.js +1 -0
- package/lib/module/games/nuts-and-bolts/NutsAndBolts.js +1 -1
- package/lib/module/games/nuts-and-bolts/NutsAndBoltsConstants.js +1 -1
- package/lib/module/games/nuts-and-bolts/NutsAndBoltsGame.js +1 -0
- package/lib/module/games/nuts-and-bolts/NutsAndBoltsRules.js +1 -0
- package/lib/module/games/nuts-and-bolts/NutsAndBoltsScene.js +1 -0
- package/lib/module/games/pac-man/PacMan.js +1 -1
- package/lib/module/games/pac-man/PacManConstants.js +1 -1
- package/lib/module/games/pac-man/PacManGame.js +1 -0
- package/lib/module/games/pac-man/PacManRules.js +1 -0
- package/lib/module/games/pac-man/PacManScene.js +1 -0
- package/lib/module/games/paper-io/PaperIo.js +1 -1
- package/lib/module/games/paper-io/PaperIoConstants.js +1 -1
- package/lib/module/games/paper-io/PaperIoGame.js +1 -0
- package/lib/module/games/paper-io/PaperIoMeshes.js +1 -0
- package/lib/module/games/paper-io/PaperIoRules.js +1 -0
- package/lib/module/games/paper-io/PaperIoScene.js +1 -0
- package/lib/module/games/penguin-run/PenguinMeshes.js +1 -0
- package/lib/module/games/penguin-run/PenguinModel.js +1 -0
- package/lib/module/games/penguin-run/PenguinRun.js +1 -0
- package/lib/module/games/penguin-run/PenguinRunConstants.js +1 -0
- package/lib/module/games/penguin-run/PenguinRunGame.js +1 -0
- package/lib/module/games/penguin-run/PenguinRunScene.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircle.js +1 -1
- package/lib/module/games/perfect-circle/PerfectCircleConstants.js +1 -1
- package/lib/module/games/perfect-circle/PerfectCircleGame.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleRules.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleScene.js +1 -0
- package/lib/module/games/pipe-connect/PipeConnect.js +1 -1
- package/lib/module/games/pipe-connect/PipeConnectConstants.js +1 -1
- package/lib/module/games/pipe-connect/PipeConnectGame.js +1 -0
- package/lib/module/games/pipe-connect/PipeConnectRules.js +1 -0
- package/lib/module/games/pipe-connect/PipeConnectScene.js +1 -0
- package/lib/module/games/play-with-tua/PlayWithTua.js +1 -0
- package/lib/module/games/play-with-tua/PlayWithTuaConstants.js +1 -0
- package/lib/module/games/play-with-tua/PlayWithTuaGame.js +1 -0
- package/lib/module/games/play-with-tua/PlayWithTuaModel.js +1 -0
- package/lib/module/games/play-with-tua/PlayWithTuaScene.js +1 -0
- package/lib/module/games/popit-fidget/PopitFidget.js +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetGame.js +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetScene.js +1 -0
- package/lib/module/games/reversi/Reversi.js +1 -1
- package/lib/module/games/reversi/ReversiConstants.js +1 -1
- package/lib/module/games/reversi/ReversiGame.js +1 -0
- package/lib/module/games/reversi/ReversiRules.js +1 -0
- package/lib/module/games/reversi/ReversiScene.js +1 -0
- package/lib/module/games/search-grid/SearchGrid.js +1 -0
- package/lib/module/games/search-grid/SearchGridConstants.js +1 -0
- package/lib/module/games/search-grid/SearchGridGame.js +1 -0
- package/lib/module/games/search-grid/SearchGridScene.js +1 -0
- package/lib/module/games/shared/BackdropCard.js +1 -0
- package/lib/module/games/shared/EngineBackdrop.js +1 -0
- package/lib/module/games/shared/EngineBlasts.js +1 -0
- package/lib/module/games/shared/EngineBlocks.js +1 -0
- package/lib/module/games/shared/EngineControlText.js +1 -0
- package/lib/module/games/shared/EngineDice.js +1 -0
- package/lib/module/games/shared/EngineFootprint.js +1 -0
- package/lib/module/games/shared/EngineFruits.js +1 -0
- package/lib/module/games/shared/EngineGameLoader.js +1 -0
- package/lib/module/games/shared/EngineGameScreen.js +1 -0
- package/lib/module/games/shared/EngineGameWidth.js +1 -0
- package/lib/module/games/shared/EngineGameWidth.web.js +1 -0
- package/lib/module/games/shared/EngineGlyphs.js +1 -0
- package/lib/module/games/shared/EngineHud.js +1 -0
- package/lib/module/games/shared/EngineLoading.js +1 -0
- package/lib/module/games/shared/EngineMeadow.js +1 -0
- package/lib/module/games/shared/EngineMeshCache.js +1 -0
- package/lib/module/games/shared/EngineMeshes.js +1 -0
- package/lib/module/games/shared/EngineRacingChase.js +1 -0
- package/lib/module/games/shared/EngineRacingHandling.js +1 -0
- package/lib/module/games/shared/EngineReadyContext.js +1 -0
- package/lib/module/games/shared/EngineTilt.js +1 -0
- package/lib/module/games/shared/EngineTouchSurface.js +1 -0
- package/lib/module/games/shared/EngineUtils.js +1 -0
- package/lib/module/games/shared/GameActivity.js +1 -0
- package/lib/module/games/shared/GameLoading.js +1 -0
- package/lib/module/games/shared/GameLoadingTransition.js +1 -0
- package/lib/module/games/shared/ProceduralCacheVersion.js +1 -0
- package/lib/module/games/shared/useEngineGame.js +1 -0
- package/lib/module/games/shared/useGameResource.js +1 -0
- package/lib/module/games/shared/useLiveState.js +1 -0
- package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersGame.js +1 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersRules.js +1 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersScene.js +1 -0
- package/lib/module/games/snake-3d/Snake3D.js +1 -1
- package/lib/module/games/snake-3d/Snake3DConstants.js +1 -1
- package/lib/module/games/snake-3d/Snake3DGame.js +1 -0
- package/lib/module/games/snake-3d/Snake3DMotion.js +1 -0
- package/lib/module/games/snake-3d/Snake3DRules.js +1 -0
- package/lib/module/games/snake-3d/Snake3DScene.js +1 -0
- package/lib/module/games/snakes-and-ladders/SnakesAndLadders.js +1 -1
- package/lib/module/games/snakes-and-ladders/SnakesAndLaddersConstants.js +1 -1
- package/lib/module/games/snakes-and-ladders/SnakesAndLaddersGame.js +1 -0
- package/lib/module/games/snakes-and-ladders/SnakesAndLaddersScene.js +1 -0
- package/lib/module/games/space-fighter/SpaceFighter.js +1 -1
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -1
- package/lib/module/games/space-fighter/SpaceFighterGame.js +1 -0
- package/lib/module/games/space-fighter/SpaceFighterScene.js +1 -0
- package/lib/module/games/spider-solitaire/SpiderSolitaire.js +1 -1
- package/lib/module/games/spider-solitaire/SpiderSolitaireConstants.js +1 -1
- package/lib/module/games/spider-solitaire/SpiderSolitaireGame.js +1 -0
- package/lib/module/games/spider-solitaire/SpiderSolitaireRules.js +1 -0
- package/lib/module/games/spider-solitaire/SpiderSolitaireScene.js +1 -0
- package/lib/module/games/stack-tower/StackTower.js +1 -1
- package/lib/module/games/stack-tower/StackTowerConstants.js +1 -1
- package/lib/module/games/stack-tower/StackTowerGame.js +1 -0
- package/lib/module/games/stack-tower/StackTowerScene.js +1 -0
- package/lib/module/games/sudoku/Sudoku.js +1 -1
- package/lib/module/games/sudoku/SudokuConstants.js +1 -1
- package/lib/module/games/sudoku/SudokuGame.js +1 -0
- package/lib/module/games/sudoku/SudokuRules.js +1 -0
- package/lib/module/games/sudoku/SudokuScene.js +1 -0
- package/lib/module/games/tangram/Tangram.js +1 -1
- package/lib/module/games/tangram/TangramConstants.js +1 -1
- package/lib/module/games/tangram/TangramGame.js +1 -0
- package/lib/module/games/tangram/TangramRules.js +1 -0
- package/lib/module/games/tangram/TangramScene.js +1 -0
- package/lib/module/games/tank-1990/Tank1990.js +1 -1
- package/lib/module/games/tank-1990/Tank1990Constants.js +1 -1
- package/lib/module/games/tank-1990/Tank1990Game.js +1 -0
- package/lib/module/games/tank-1990/Tank1990Rules.js +1 -0
- package/lib/module/games/tank-1990/Tank1990Scene.js +1 -0
- package/lib/module/games/tic-tac-toe/TicTacToe.js +1 -1
- package/lib/module/games/tic-tac-toe/TicTacToeConstants.js +1 -1
- package/lib/module/games/tic-tac-toe/TicTacToeGame.js +1 -0
- package/lib/module/games/tic-tac-toe/TicTacToeRules.js +1 -0
- package/lib/module/games/tic-tac-toe/TicTacToeScene.js +1 -0
- package/lib/module/games/tile-home/TileHome.js +1 -1
- package/lib/module/games/tile-home/TileHomeConstants.js +1 -1
- package/lib/module/games/tile-home/TileHomeGame.js +1 -0
- package/lib/module/games/tile-home/TileHomeScene.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHunt.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntConstants.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntControls.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntGame.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntMeshes.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntModel.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntRules.js +1 -0
- package/lib/module/games/treasure-hunt/TreasureHuntScene.js +1 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleGame.js +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleScene.js +1 -0
- package/lib/module/games/word-search/WordSearch.js +1 -1
- package/lib/module/games/word-search/WordSearchWords.js +1 -0
- package/lib/module/helpers/GamePatternData.js +1 -0
- package/lib/module/helpers/GameSettingsModal.js +1 -1
- package/lib/module/helpers/GameTheme.js +1 -0
- package/lib/module/helpers/IconPaths.js +1 -0
- package/lib/module/helpers/index.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/services/GameAssetLoader.js +1 -0
- package/lib/module/services/GameAssets.js +1 -0
- package/lib/module/services/GameLoaders.js +1 -0
- package/lib/module/services/GamesConstants.js +1 -1
- package/lib/module/services/GamesMetadata.js +1 -1
- package/lib/module/services/GamesService.js +1 -1
- package/lib/module/services/HapticsService.js +1 -1
- package/lib/module/services/ScoringService.js +1 -1
- package/lib/module/services/SfxSources.js +1 -0
- package/lib/module/services/SoundsService.js +1 -1
- package/lib/module/services/ThemeService.js +1 -0
- package/lib/module/services/UtilsService.js +1 -1
- package/lib/module/services/index.js +1 -1
- package/lib/typescript/src/games/arrows/Arrows.d.ts +1 -3
- package/lib/typescript/src/games/arrows/ArrowsConstants.d.ts +48 -32
- package/lib/typescript/src/games/arrows/ArrowsGame.d.ts +60 -0
- package/lib/typescript/src/games/arrows/ArrowsScene.d.ts +67 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +1 -3
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +39 -131
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterGame.d.ts +57 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterPhysics.d.ts +16 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterScene.d.ts +31 -0
- package/lib/typescript/src/games/bike-racing/BikeMeshes.d.ts +14 -0
- package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts +2 -1
- package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts +38 -29
- package/lib/typescript/src/games/bike-racing/BikeRacingGame.d.ts +104 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingScene.d.ts +25 -0
- package/lib/typescript/src/games/block-blast/BlockBlast.d.ts +1 -3
- package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts +48 -30
- package/lib/typescript/src/games/block-blast/BlockBlastGame.d.ts +77 -0
- package/lib/typescript/src/games/block-blast/BlockBlastScene.d.ts +36 -0
- package/lib/typescript/src/games/block-breaker/BlockBreaker.d.ts +1 -3
- package/lib/typescript/src/games/block-breaker/BlockBreakerConstants.d.ts +88 -35
- package/lib/typescript/src/games/block-breaker/BlockBreakerGame.d.ts +82 -0
- package/lib/typescript/src/games/block-breaker/BlockBreakerScene.d.ts +48 -0
- package/lib/typescript/src/games/bluk/Bluk.d.ts +1 -3
- package/lib/typescript/src/games/bluk/BlukConstants.d.ts +65 -54
- package/lib/typescript/src/games/bluk/BlukGame.d.ts +65 -0
- package/lib/typescript/src/games/bluk/BlukRules.d.ts +51 -0
- package/lib/typescript/src/games/bluk/BlukScene.d.ts +54 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts +1 -3
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts +56 -24
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterGame.d.ts +70 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterScene.d.ts +26 -0
- package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts +1 -3
- package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +63 -32
- package/lib/typescript/src/games/candy-crush/CandyCrushGame.d.ts +65 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushScene.d.ts +28 -0
- package/lib/typescript/src/games/car-racing/CarMeshes.d.ts +44 -0
- package/lib/typescript/src/games/car-racing/CarRacing.d.ts +2 -1
- package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts +60 -29
- package/lib/typescript/src/games/car-racing/CarRacingFacade.d.ts +5 -0
- package/lib/typescript/src/games/car-racing/CarRacingGame.d.ts +96 -0
- package/lib/typescript/src/games/car-racing/CarRacingScene.d.ts +97 -0
- package/lib/typescript/src/games/car-racing/CarRacingScenery.d.ts +22 -0
- package/lib/typescript/src/games/chameleon-run/ChameleonRun.d.ts +1 -3
- package/lib/typescript/src/games/chameleon-run/ChameleonRunBackdrop.d.ts +14 -0
- package/lib/typescript/src/games/chameleon-run/ChameleonRunConstants.d.ts +44 -42
- package/lib/typescript/src/games/chameleon-run/ChameleonRunGame.d.ts +60 -0
- package/lib/typescript/src/games/chameleon-run/ChameleonRunMeshes.d.ts +20 -0
- package/lib/typescript/src/games/chameleon-run/ChameleonRunRules.d.ts +52 -0
- package/lib/typescript/src/games/chameleon-run/ChameleonRunScene.d.ts +44 -0
- package/lib/typescript/src/games/checkers/Checkers.d.ts +1 -3
- package/lib/typescript/src/games/checkers/CheckersAI.d.ts +11 -0
- package/lib/typescript/src/games/checkers/CheckersConstants.d.ts +32 -72
- package/lib/typescript/src/games/checkers/CheckersGame.d.ts +56 -0
- package/lib/typescript/src/games/checkers/CheckersRules.d.ts +48 -0
- package/lib/typescript/src/games/checkers/CheckersScene.d.ts +41 -0
- package/lib/typescript/src/games/color-switch/ColorSwitch.d.ts +1 -3
- package/lib/typescript/src/games/color-switch/ColorSwitchConstants.d.ts +27 -31
- package/lib/typescript/src/games/color-switch/ColorSwitchGame.d.ts +61 -0
- package/lib/typescript/src/games/color-switch/ColorSwitchScene.d.ts +43 -0
- package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts +1 -3
- package/lib/typescript/src/games/colors-sort/ColorsSortConstants.d.ts +37 -44
- package/lib/typescript/src/games/colors-sort/ColorsSortGame.d.ts +41 -0
- package/lib/typescript/src/games/colors-sort/ColorsSortScene.d.ts +33 -0
- package/lib/typescript/src/games/connect-em-all/ConnectEmAll.d.ts +1 -3
- package/lib/typescript/src/games/connect-em-all/ConnectEmAllConstants.d.ts +43 -17
- package/lib/typescript/src/games/connect-em-all/ConnectEmAllGame.d.ts +54 -0
- package/lib/typescript/src/games/connect-em-all/ConnectEmAllScene.d.ts +49 -0
- package/lib/typescript/src/games/crossy-road/CrossyRoad.d.ts +1 -3
- package/lib/typescript/src/games/crossy-road/CrossyRoadCamera.d.ts +14 -0
- package/lib/typescript/src/games/crossy-road/CrossyRoadConstants.d.ts +82 -50
- package/lib/typescript/src/games/crossy-road/CrossyRoadGame.d.ts +64 -0
- package/lib/typescript/src/games/crossy-road/CrossyRoadMeshes.d.ts +16 -0
- package/lib/typescript/src/games/crossy-road/CrossyRoadPerson.d.ts +10 -0
- package/lib/typescript/src/games/crossy-road/CrossyRoadRules.d.ts +36 -0
- package/lib/typescript/src/games/crossy-road/CrossyRoadScene.d.ts +38 -0
- package/lib/typescript/src/games/dino-jump/DinoJump.d.ts +1 -3
- package/lib/typescript/src/games/dino-jump/DinoJumpConstants.d.ts +48 -72
- package/lib/typescript/src/games/dino-jump/DinoJumpGame.d.ts +60 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpScene.d.ts +35 -0
- package/lib/typescript/src/games/dots-and-boxes/DotsAndBoxes.d.ts +1 -3
- package/lib/typescript/src/games/dots-and-boxes/DotsAndBoxesConstants.d.ts +31 -36
- package/lib/typescript/src/games/dots-and-boxes/DotsAndBoxesGame.d.ts +44 -0
- package/lib/typescript/src/games/dots-and-boxes/DotsAndBoxesScene.d.ts +31 -0
- package/lib/typescript/src/games/falling-sticks/FallingSticks.d.ts +1 -3
- package/lib/typescript/src/games/falling-sticks/FallingSticksConstants.d.ts +31 -43
- package/lib/typescript/src/games/falling-sticks/FallingSticksGame.d.ts +42 -0
- package/lib/typescript/src/games/falling-sticks/FallingSticksRules.d.ts +36 -0
- package/lib/typescript/src/games/falling-sticks/FallingSticksScene.d.ts +26 -0
- package/lib/typescript/src/games/find-different-number/FindDifferentNumber.d.ts +1 -3
- package/lib/typescript/src/games/find-different-number/FindDifferentNumberConstants.d.ts +33 -29
- package/lib/typescript/src/games/find-different-number/FindDifferentNumberGame.d.ts +43 -0
- package/lib/typescript/src/games/find-different-number/FindDifferentNumberRules.d.ts +8 -0
- package/lib/typescript/src/games/find-different-number/FindDifferentNumberScene.d.ts +31 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts +1 -3
- package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts +39 -35
- package/lib/typescript/src/games/flappy-bird/FlappyBirdGame.d.ts +66 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBirdScene.d.ts +41 -0
- package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts +1 -3
- package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts +71 -44
- package/lib/typescript/src/games/fruit-merger/FruitMergerGame.d.ts +63 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerRules.d.ts +39 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerScene.d.ts +49 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +1 -3
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +51 -76
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaGame.d.ts +76 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaScene.d.ts +52 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaWorld.d.ts +8 -0
- package/lib/typescript/src/games/game-2048/Game2048.d.ts +1 -3
- package/lib/typescript/src/games/game-2048/Game2048Constants.d.ts +25 -120
- package/lib/typescript/src/games/game-2048/Game2048Game.d.ts +45 -0
- package/lib/typescript/src/games/game-2048/Game2048Rules.d.ts +32 -0
- package/lib/typescript/src/games/game-2048/Game2048Scene.d.ts +34 -0
- package/lib/typescript/src/games/knife-hit/KnifeHit.d.ts +1 -3
- package/lib/typescript/src/games/knife-hit/KnifeHitConstants.d.ts +41 -49
- package/lib/typescript/src/games/knife-hit/KnifeHitGame.d.ts +49 -0
- package/lib/typescript/src/games/knife-hit/KnifeHitScene.d.ts +37 -0
- package/lib/typescript/src/games/ludo-king/LudoKing.d.ts +1 -3
- package/lib/typescript/src/games/ludo-king/LudoKingConstants.d.ts +50 -28
- package/lib/typescript/src/games/ludo-king/LudoKingGame.d.ts +40 -0
- package/lib/typescript/src/games/ludo-king/LudoKingRules.d.ts +42 -0
- package/lib/typescript/src/games/ludo-king/LudoKingScene.d.ts +53 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +1 -3
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +34 -10
- package/lib/typescript/src/games/maze-runner/MazeRunnerGame.d.ts +44 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerRules.d.ts +34 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerScene.d.ts +29 -0
- package/lib/typescript/src/games/memory-match/MemoryMatch.d.ts +1 -3
- package/lib/typescript/src/games/memory-match/MemoryMatchConstants.d.ts +42 -42
- package/lib/typescript/src/games/memory-match/MemoryMatchGame.d.ts +53 -0
- package/lib/typescript/src/games/memory-match/MemoryMatchRules.d.ts +14 -0
- package/lib/typescript/src/games/memory-match/MemoryMatchScene.d.ts +35 -0
- package/lib/typescript/src/games/mine-sweeper/MineSweeper.d.ts +1 -3
- package/lib/typescript/src/games/mine-sweeper/MineSweeperConstants.d.ts +43 -82
- package/lib/typescript/src/games/mine-sweeper/MineSweeperGame.d.ts +59 -0
- package/lib/typescript/src/games/mine-sweeper/MineSweeperRules.d.ts +18 -0
- package/lib/typescript/src/games/mine-sweeper/MineSweeperScene.d.ts +23 -0
- package/lib/typescript/src/games/mob-control/MobControl.d.ts +1 -3
- package/lib/typescript/src/games/mob-control/MobControlConstants.d.ts +99 -85
- package/lib/typescript/src/games/mob-control/MobControlGame.d.ts +45 -0
- package/lib/typescript/src/games/mob-control/MobControlMeshes.d.ts +2 -0
- package/lib/typescript/src/games/mob-control/MobControlRenderer.d.ts +20 -0
- package/lib/typescript/src/games/mob-control/MobControlRules.d.ts +68 -0
- package/lib/typescript/src/games/mob-control/MobControlScene.d.ts +58 -0
- package/lib/typescript/src/games/number-search/NumberSearch.d.ts +1 -3
- package/lib/typescript/src/games/number-search/NumberSearchNumbers.d.ts +1 -0
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBolts.d.ts +1 -3
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBoltsConstants.d.ts +27 -79
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBoltsGame.d.ts +56 -0
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBoltsRules.d.ts +65 -0
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBoltsScene.d.ts +48 -0
- package/lib/typescript/src/games/pac-man/PacMan.d.ts +1 -3
- package/lib/typescript/src/games/pac-man/PacManConstants.d.ts +66 -106
- package/lib/typescript/src/games/pac-man/PacManGame.d.ts +48 -0
- package/lib/typescript/src/games/pac-man/PacManRules.d.ts +52 -0
- package/lib/typescript/src/games/pac-man/PacManScene.d.ts +44 -0
- package/lib/typescript/src/games/paper-io/PaperIo.d.ts +1 -3
- package/lib/typescript/src/games/paper-io/PaperIoConstants.d.ts +60 -40
- package/lib/typescript/src/games/paper-io/PaperIoGame.d.ts +49 -0
- package/lib/typescript/src/games/paper-io/PaperIoMeshes.d.ts +13 -0
- package/lib/typescript/src/games/paper-io/PaperIoRules.d.ts +71 -0
- package/lib/typescript/src/games/paper-io/PaperIoScene.d.ts +39 -0
- package/lib/typescript/src/games/penguin-run/PenguinMeshes.d.ts +9 -0
- package/lib/typescript/src/games/penguin-run/PenguinModel.d.ts +42 -0
- package/lib/typescript/src/games/penguin-run/PenguinRun.d.ts +1 -0
- package/lib/typescript/src/games/penguin-run/PenguinRunConstants.d.ts +58 -0
- package/lib/typescript/src/games/penguin-run/PenguinRunGame.d.ts +64 -0
- package/lib/typescript/src/games/penguin-run/PenguinRunScene.d.ts +65 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts +1 -3
- package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts +23 -45
- package/lib/typescript/src/games/perfect-circle/PerfectCircleGame.d.ts +40 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleRules.d.ts +55 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleScene.d.ts +32 -0
- package/lib/typescript/src/games/pipe-connect/PipeConnect.d.ts +1 -3
- package/lib/typescript/src/games/pipe-connect/PipeConnectConstants.d.ts +36 -32
- package/lib/typescript/src/games/pipe-connect/PipeConnectGame.d.ts +40 -0
- package/lib/typescript/src/games/pipe-connect/PipeConnectRules.d.ts +16 -0
- package/lib/typescript/src/games/pipe-connect/PipeConnectScene.d.ts +28 -0
- package/lib/typescript/src/games/play-with-tua/PlayWithTua.d.ts +2 -0
- package/lib/typescript/src/games/play-with-tua/PlayWithTuaConstants.d.ts +64 -0
- package/lib/typescript/src/games/play-with-tua/PlayWithTuaGame.d.ts +34 -0
- package/lib/typescript/src/games/play-with-tua/PlayWithTuaModel.d.ts +9 -0
- package/lib/typescript/src/games/play-with-tua/PlayWithTuaScene.d.ts +13 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +1 -4
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +25 -36
- package/lib/typescript/src/games/popit-fidget/PopitFidgetGame.d.ts +37 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetScene.d.ts +19 -0
- package/lib/typescript/src/games/reversi/Reversi.d.ts +1 -3
- package/lib/typescript/src/games/reversi/ReversiConstants.d.ts +31 -62
- package/lib/typescript/src/games/reversi/ReversiGame.d.ts +54 -0
- package/lib/typescript/src/games/reversi/ReversiRules.d.ts +22 -0
- package/lib/typescript/src/games/reversi/ReversiScene.d.ts +27 -0
- package/lib/typescript/src/games/search-grid/SearchGrid.d.ts +20 -0
- package/lib/typescript/src/games/search-grid/SearchGridConstants.d.ts +60 -0
- package/lib/typescript/src/games/search-grid/SearchGridGame.d.ts +52 -0
- package/lib/typescript/src/games/search-grid/SearchGridScene.d.ts +43 -0
- package/lib/typescript/src/games/shared/BackdropCard.d.ts +2 -0
- package/lib/typescript/src/games/shared/EngineBackdrop.d.ts +19 -0
- package/lib/typescript/src/games/shared/EngineBlasts.d.ts +26 -0
- package/lib/typescript/src/games/shared/EngineBlocks.d.ts +19 -0
- package/lib/typescript/src/games/shared/EngineControlText.d.ts +2 -0
- package/lib/typescript/src/games/shared/EngineDice.d.ts +24 -0
- package/lib/typescript/src/games/shared/EngineFootprint.d.ts +17 -0
- package/lib/typescript/src/games/shared/EngineFruits.d.ts +27 -0
- package/lib/typescript/src/games/shared/EngineGameLoader.d.ts +4 -0
- package/lib/typescript/src/games/shared/EngineGameScreen.d.ts +48 -0
- package/lib/typescript/src/games/shared/EngineGameWidth.d.ts +3 -0
- package/lib/typescript/src/games/shared/EngineGameWidth.web.d.ts +3 -0
- package/lib/typescript/src/games/shared/EngineGlyphs.d.ts +15 -0
- package/lib/typescript/src/games/shared/EngineHud.d.ts +138 -0
- package/lib/typescript/src/games/shared/EngineLoading.d.ts +77 -0
- package/lib/typescript/src/games/shared/EngineMeadow.d.ts +90 -0
- package/lib/typescript/src/games/shared/EngineMeshCache.d.ts +3 -0
- package/lib/typescript/src/games/shared/EngineMeshes.d.ts +3 -0
- package/lib/typescript/src/games/shared/EngineRacingChase.d.ts +11 -0
- package/lib/typescript/src/games/shared/EngineRacingHandling.d.ts +15 -0
- package/lib/typescript/src/games/shared/EngineReadyContext.d.ts +2 -0
- package/lib/typescript/src/games/shared/EngineTilt.d.ts +19 -0
- package/lib/typescript/src/games/shared/EngineTouchSurface.d.ts +20 -0
- package/lib/typescript/src/games/shared/EngineUtils.d.ts +18 -0
- package/lib/typescript/src/games/shared/GameActivity.d.ts +3 -0
- package/lib/typescript/src/games/shared/GameLoading.d.ts +14 -0
- package/lib/typescript/src/games/shared/GameLoadingTransition.d.ts +9 -0
- package/lib/typescript/src/games/shared/ProceduralCacheVersion.d.ts +1 -0
- package/lib/typescript/src/games/shared/useEngineGame.d.ts +69 -0
- package/lib/typescript/src/games/shared/useGameResource.d.ts +2 -0
- package/lib/typescript/src/games/shared/useLiveState.d.ts +4 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts +1 -3
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersConstants.d.ts +32 -40
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersGame.d.ts +48 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersRules.d.ts +22 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersScene.d.ts +30 -0
- package/lib/typescript/src/games/snake-3d/Snake3D.d.ts +1 -3
- package/lib/typescript/src/games/snake-3d/Snake3DConstants.d.ts +31 -68
- package/lib/typescript/src/games/snake-3d/Snake3DGame.d.ts +42 -0
- package/lib/typescript/src/games/snake-3d/Snake3DMotion.d.ts +3 -0
- package/lib/typescript/src/games/snake-3d/Snake3DRules.d.ts +42 -0
- package/lib/typescript/src/games/snake-3d/Snake3DScene.d.ts +35 -0
- package/lib/typescript/src/games/snakes-and-ladders/SnakesAndLadders.d.ts +1 -3
- package/lib/typescript/src/games/snakes-and-ladders/SnakesAndLaddersConstants.d.ts +58 -50
- package/lib/typescript/src/games/snakes-and-ladders/SnakesAndLaddersGame.d.ts +45 -0
- package/lib/typescript/src/games/snakes-and-ladders/SnakesAndLaddersScene.d.ts +50 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +1 -3
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +33 -23
- package/lib/typescript/src/games/space-fighter/SpaceFighterGame.d.ts +58 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterScene.d.ts +51 -0
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaire.d.ts +1 -3
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaireConstants.d.ts +52 -35
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaireGame.d.ts +67 -0
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaireRules.d.ts +39 -0
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaireScene.d.ts +60 -0
- package/lib/typescript/src/games/stack-tower/StackTower.d.ts +1 -3
- package/lib/typescript/src/games/stack-tower/StackTowerConstants.d.ts +31 -23
- package/lib/typescript/src/games/stack-tower/StackTowerGame.d.ts +58 -0
- package/lib/typescript/src/games/stack-tower/StackTowerScene.d.ts +27 -0
- package/lib/typescript/src/games/sudoku/Sudoku.d.ts +1 -3
- package/lib/typescript/src/games/sudoku/SudokuConstants.d.ts +50 -55
- package/lib/typescript/src/games/sudoku/SudokuGame.d.ts +56 -0
- package/lib/typescript/src/games/sudoku/SudokuRules.d.ts +23 -0
- package/lib/typescript/src/games/sudoku/SudokuScene.d.ts +44 -0
- package/lib/typescript/src/games/tangram/Tangram.d.ts +1 -3
- package/lib/typescript/src/games/tangram/TangramConstants.d.ts +33 -52
- package/lib/typescript/src/games/tangram/TangramGame.d.ts +68 -0
- package/lib/typescript/src/games/tangram/TangramRules.d.ts +61 -0
- package/lib/typescript/src/games/tangram/TangramScene.d.ts +42 -0
- package/lib/typescript/src/games/tank-1990/Tank1990.d.ts +1 -3
- package/lib/typescript/src/games/tank-1990/Tank1990Constants.d.ts +44 -127
- package/lib/typescript/src/games/tank-1990/Tank1990Game.d.ts +50 -0
- package/lib/typescript/src/games/tank-1990/Tank1990Rules.d.ts +67 -0
- package/lib/typescript/src/games/tank-1990/Tank1990Scene.d.ts +38 -0
- package/lib/typescript/src/games/tic-tac-toe/TicTacToe.d.ts +1 -3
- package/lib/typescript/src/games/tic-tac-toe/TicTacToeConstants.d.ts +35 -72
- package/lib/typescript/src/games/tic-tac-toe/TicTacToeGame.d.ts +54 -0
- package/lib/typescript/src/games/tic-tac-toe/TicTacToeRules.d.ts +10 -0
- package/lib/typescript/src/games/tic-tac-toe/TicTacToeScene.d.ts +26 -0
- package/lib/typescript/src/games/tile-home/TileHome.d.ts +1 -3
- package/lib/typescript/src/games/tile-home/TileHomeConstants.d.ts +72 -70
- package/lib/typescript/src/games/tile-home/TileHomeGame.d.ts +72 -0
- package/lib/typescript/src/games/tile-home/TileHomeScene.d.ts +28 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHunt.d.ts +3 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntConstants.d.ts +144 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntControls.d.ts +75 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntGame.d.ts +41 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntMeshes.d.ts +26 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntModel.d.ts +57 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntRules.d.ts +198 -0
- package/lib/typescript/src/games/treasure-hunt/TreasureHuntScene.d.ts +40 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +1 -3
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +35 -45
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleGame.d.ts +51 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleScene.d.ts +31 -0
- package/lib/typescript/src/games/word-search/WordSearch.d.ts +1 -3
- package/lib/typescript/src/games/word-search/WordSearchWords.d.ts +1 -0
- package/lib/typescript/src/helpers/GamePatternData.d.ts +46 -0
- package/lib/typescript/src/helpers/GameSettingsModal.d.ts +1 -1
- package/lib/typescript/src/helpers/GameTheme.d.ts +18 -0
- package/lib/typescript/src/helpers/IconPaths.d.ts +4 -0
- package/lib/typescript/src/helpers/index.d.ts +1 -19
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/services/GameAssetLoader.d.ts +32 -0
- package/lib/typescript/src/services/GameAssets.d.ts +11 -0
- package/lib/typescript/src/services/GameLoaders.d.ts +18 -0
- package/lib/typescript/src/services/GamesConstants.d.ts +11 -0
- package/lib/typescript/src/services/GamesMetadata.d.ts +2 -0
- package/lib/typescript/src/services/HapticsService.d.ts +1 -1
- package/lib/typescript/src/services/SfxSources.d.ts +79 -0
- package/lib/typescript/src/services/SoundsService.d.ts +487 -1566
- package/lib/typescript/src/services/ThemeService.d.ts +117 -0
- package/lib/typescript/src/services/UtilsService.d.ts +20 -2
- package/lib/typescript/src/services/index.d.ts +3 -0
- package/lib/web/assets/005ea2045b17-explorer.glb +0 -0
- package/lib/web/assets/01e2f0a0bbf6-hurt.wav +0 -0
- package/lib/web/assets/01fc0ecf658c-explorer-atlas.png +0 -0
- package/lib/web/assets/029329b2c7c0-asphalt.png +0 -0
- package/lib/web/assets/0376bda32be3-robot.wav +0 -0
- package/lib/web/assets/0719fb0bb38e-soft_glow.png +0 -0
- package/lib/web/assets/0b21278bffba-boing.wav +0 -0
- package/lib/web/assets/1333c9d1273c-flip_disc.wav +0 -0
- package/lib/web/assets/15785f62ee5f-time_up.wav +0 -0
- package/lib/web/assets/177f00502e08-bonus.wav +0 -0
- package/lib/web/assets/19e47dcfda1f-pling.wav +0 -0
- package/lib/web/assets/1a677e0f7f6c-laugh.wav +0 -0
- package/lib/web/assets/1ad2914478b1-eat.wav +0 -0
- package/lib/web/assets/1b0d703ddd1a-dance.wav +0 -0
- package/lib/web/assets/1e4330fddd74-chime.wav +0 -0
- package/lib/web/assets/2432a97b0af1-cannon.wav +0 -0
- package/lib/web/assets/2574370d6aa0-blocked.wav +0 -0
- package/lib/web/assets/2699065037ad-select.wav +0 -0
- package/lib/web/assets/28d30f53ad73-ladder.wav +0 -0
- package/lib/web/assets/2c1ec05270b2-point.wav +0 -0
- package/lib/web/assets/2e1dd99a0213-tick.wav +0 -0
- package/lib/web/assets/3084575cecdb-card_flip.wav +0 -0
- package/lib/web/assets/308bc31b6af5-engine.wav +0 -0
- package/lib/web/assets/336d63b739b5-combo.wav +0 -0
- package/lib/web/assets/3a369e2596e4-clash.wav +0 -0
- package/lib/web/assets/3a816e20212f-capture.wav +0 -0
- package/lib/web/assets/40240217810a-nitro.wav +0 -0
- package/lib/web/assets/46edaa54d1ea-crunch.wav +0 -0
- package/lib/web/assets/501994226995-coin.wav +0 -0
- package/lib/web/assets/5525d7f6a4b8-rotate.wav +0 -0
- package/lib/web/assets/5e816e1f0929-dice_roll.wav +0 -0
- package/lib/web/assets/60e2dec3cf41-deselect.wav +0 -0
- package/lib/web/assets/6ab86ea29e5c-six.wav +0 -0
- package/lib/web/assets/6da3b101926d-merge.wav +0 -0
- package/lib/web/assets/6e686dea513c-bark.jpg +0 -0
- package/lib/web/assets/6ff9a6a13714-limestone.jpg +0 -0
- package/lib/web/assets/735c4a1cd22e-invalid.wav +0 -0
- package/lib/web/assets/73f75c35ff5d-snake.wav +0 -0
- package/lib/web/assets/7506e3efe264-catch.wav +0 -0
- package/lib/web/assets/76493a2ada2d-ad_bolt.png +0 -0
- package/lib/web/assets/793abe620201-card_place.wav +0 -0
- package/lib/web/assets/7da09c57f52d-facade.png +0 -0
- package/lib/web/assets/7e1a902176f6-pine.png +0 -0
- package/lib/web/assets/7eb943b85c21-play-with-tua.glb +0 -0
- package/lib/web/assets/837d43c06dba-ad_bubbles.png +0 -0
- package/lib/web/assets/84f1a7dfa368-game_over.wav +0 -0
- package/lib/web/assets/850e26ce3b0a-flap.wav +0 -0
- package/lib/web/assets/854b31683cb2-draw.wav +0 -0
- package/lib/web/assets/8616150393b7-error.wav +0 -0
- package/lib/web/assets/87cc6d503ec6-river.jpg +0 -0
- package/lib/web/assets/88755845922c-hop.wav +0 -0
- package/lib/web/assets/8ec8f469492d-chomp_alt.wav +0 -0
- package/lib/web/assets/8f17f89b138c-pew.wav +0 -0
- package/lib/web/assets/9210a24472d1-place.wav +0 -0
- package/lib/web/assets/930d833ebf89-splash.wav +0 -0
- package/lib/web/assets/970f7c59265d-swoosh.wav +0 -0
- package/lib/web/assets/9900b8d1b6ad-flag.wav +0 -0
- package/lib/web/assets/9ab04403898b-clang.wav +0 -0
- package/lib/web/assets/9d8b97a10d45-drop.wav +0 -0
- package/lib/web/assets/9d9c02ddc7ed-boom.wav +0 -0
- package/lib/web/assets/9e1b5114d56d-pop_soft.wav +0 -0
- package/lib/web/assets/a01f22d6dbb3-thud.wav +0 -0
- package/lib/web/assets/a44a1cf1a1a8-bump.wav +0 -0
- package/lib/web/assets/a76940a48c68-hit.wav +0 -0
- package/lib/web/assets/a98ddb724460-leaves.png +0 -0
- package/lib/web/assets/aa0960e8bee6-footstep_run.wav +0 -0
- package/lib/web/assets/aa570c9d3e15-star.wav +0 -0
- package/lib/web/assets/aacb999f3c49-tock.wav +0 -0
- package/lib/web/assets/aae0c16c5e89-reveal.wav +0 -0
- package/lib/web/assets/ab37cd128509-click.wav +0 -0
- package/lib/web/assets/b0bc66f49005-warning.wav +0 -0
- package/lib/web/assets/b1edd756ac43-zap.wav +0 -0
- package/lib/web/assets/b3894545cf71-slice.wav +0 -0
- package/lib/web/assets/b3c6225d055a-meadow.jpg +0 -0
- package/lib/web/assets/b60ca65cdfcb-gate.wav +0 -0
- package/lib/web/assets/b8900bb2c5c7-win.wav +0 -0
- package/lib/web/assets/baff6feda846-lose.wav +0 -0
- package/lib/web/assets/bed31305d60d-ad_chevrons.png +0 -0
- package/lib/web/assets/c26f4a624e7d-shuffle.wav +0 -0
- package/lib/web/assets/c3a9edfad195-die.wav +0 -0
- package/lib/web/assets/c4aa9d773f2a-footstep_walk.wav +0 -0
- package/lib/web/assets/c5ab3ff0003f-crash.wav +0 -0
- package/lib/web/assets/c5eb07deddd4-start.wav +0 -0
- package/lib/web/assets/c6c58d9ae452-pop.wav +0 -0
- package/lib/web/assets/cea48c3cd9c7-balloon_pop.wav +0 -0
- package/lib/web/assets/d15591767778-tap.wav +0 -0
- package/lib/web/assets/d1781a52234f-slide.wav +0 -0
- package/lib/web/assets/d3bf2d9f793b-snap.wav +0 -0
- package/lib/web/assets/d8f59ebd3537-jump.wav +0 -0
- package/lib/web/assets/dafea2f28854-power_up.wav +0 -0
- package/lib/web/assets/e2e7f5ae2d1b-whoosh.wav +0 -0
- package/lib/web/assets/e2f90a23e1bd-chomp.wav +0 -0
- package/lib/web/assets/e454e56df89a-clack.wav +0 -0
- package/lib/web/assets/e8cbc2b88bc4-Inter-SemiBold.ttf +0 -0
- package/lib/web/assets/ed6496b891fc-land.wav +0 -0
- package/lib/web/assets/f21920200a81-thunk.wav +0 -0
- package/lib/web/assets/f753b43be89d-whack.wav +0 -0
- package/lib/web/assets/f798c4b5cf4d-miss.wav +0 -0
- package/lib/web/assets/fbe299716916-grass.png +0 -0
- package/lib/web/chunk-52ez2s9z.js +15 -0
- package/lib/web/chunk-8675t224.js +1 -0
- package/lib/web/index.js +2 -0
- package/lib/web/package.json +1 -0
- package/lib/web/services.js +2 -0
- package/package.json +94 -73
- package/src/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/src/assets/models/explorer/explorer.glb +0 -0
- package/src/assets/models/explorer/params.json +51 -0
- package/src/assets/models/explorer/source.json +222 -0
- package/src/assets/models/play-with-tua/play-with-tua.glb +0 -0
- package/src/assets/models/play-with-tua/sources.json +141 -0
- package/src/assets/sfx/balloon_pop.wav +0 -0
- package/src/assets/sfx/blocked.wav +0 -0
- package/src/assets/sfx/boing.wav +0 -0
- package/src/assets/sfx/bonus.wav +0 -0
- package/src/assets/sfx/boom.wav +0 -0
- package/src/assets/sfx/bump.wav +0 -0
- package/src/assets/sfx/cannon.wav +0 -0
- package/src/assets/sfx/capture.wav +0 -0
- package/src/assets/sfx/card_flip.wav +0 -0
- package/src/assets/sfx/card_place.wav +0 -0
- package/src/assets/sfx/catch.wav +0 -0
- package/src/assets/sfx/chime.wav +0 -0
- package/src/assets/sfx/chomp.wav +0 -0
- package/src/assets/sfx/chomp_alt.wav +0 -0
- package/src/assets/sfx/clack.wav +0 -0
- package/src/assets/sfx/clang.wav +0 -0
- package/src/assets/sfx/clash.wav +0 -0
- package/src/assets/sfx/click.wav +0 -0
- package/src/assets/sfx/coin.wav +0 -0
- package/src/assets/sfx/combo.wav +0 -0
- package/src/assets/sfx/crash.wav +0 -0
- package/src/assets/sfx/crunch.wav +0 -0
- package/src/assets/sfx/dance.wav +0 -0
- package/src/assets/sfx/deselect.wav +0 -0
- package/src/assets/sfx/dice_roll.wav +0 -0
- package/src/assets/sfx/die.wav +0 -0
- package/src/assets/sfx/draw.wav +0 -0
- package/src/assets/sfx/drop.wav +0 -0
- package/src/assets/sfx/eat.wav +0 -0
- package/src/assets/sfx/engine.wav +0 -0
- package/src/assets/sfx/error.wav +0 -0
- package/src/assets/sfx/flag.wav +0 -0
- package/src/assets/sfx/flap.wav +0 -0
- package/src/assets/sfx/flip_disc.wav +0 -0
- package/src/assets/sfx/footstep_run.wav +0 -0
- package/src/assets/sfx/footstep_walk.wav +0 -0
- package/src/assets/sfx/game_over.wav +0 -0
- package/src/assets/sfx/gate.wav +0 -0
- package/src/assets/sfx/hit.wav +0 -0
- package/src/assets/sfx/hop.wav +0 -0
- package/src/assets/sfx/hurt.wav +0 -0
- package/src/assets/sfx/invalid.wav +0 -0
- package/src/assets/sfx/jump.wav +0 -0
- package/src/assets/sfx/ladder.wav +0 -0
- package/src/assets/sfx/land.wav +0 -0
- package/src/assets/sfx/laugh.wav +0 -0
- package/src/assets/sfx/lose.wav +0 -0
- package/src/assets/sfx/merge.wav +0 -0
- package/src/assets/sfx/miss.wav +0 -0
- package/src/assets/sfx/nitro.wav +0 -0
- package/src/assets/sfx/pew.wav +0 -0
- package/src/assets/sfx/place.wav +0 -0
- package/src/assets/sfx/pling.wav +0 -0
- package/src/assets/sfx/point.wav +0 -0
- package/src/assets/sfx/pop.wav +0 -0
- package/src/assets/sfx/pop_soft.wav +0 -0
- package/src/assets/sfx/power_up.wav +0 -0
- package/src/assets/sfx/reveal.wav +0 -0
- package/src/assets/sfx/robot.wav +0 -0
- package/src/assets/sfx/rotate.wav +0 -0
- package/src/assets/sfx/run_steps.wav +0 -0
- package/src/assets/sfx/select.wav +0 -0
- package/src/assets/sfx/shuffle.wav +0 -0
- package/src/assets/sfx/six.wav +0 -0
- package/src/assets/sfx/slice.wav +0 -0
- package/src/assets/sfx/slide.wav +0 -0
- package/src/assets/sfx/snake.wav +0 -0
- package/src/assets/sfx/snap.wav +0 -0
- package/src/assets/sfx/splash.wav +0 -0
- package/src/assets/sfx/star.wav +0 -0
- package/src/assets/sfx/start.wav +0 -0
- package/src/assets/sfx/swoosh.wav +0 -0
- package/src/assets/sfx/tap.wav +0 -0
- package/src/assets/sfx/thud.wav +0 -0
- package/src/assets/sfx/thunk.wav +0 -0
- package/src/assets/sfx/tick.wav +0 -0
- package/src/assets/sfx/time_up.wav +0 -0
- package/src/assets/sfx/tock.wav +0 -0
- package/src/assets/sfx/walk_steps.wav +0 -0
- package/src/assets/sfx/warning.wav +0 -0
- package/src/assets/sfx/whack.wav +0 -0
- package/src/assets/sfx/whoosh.wav +0 -0
- package/src/assets/sfx/win.wav +0 -0
- package/src/assets/sfx/zap.wav +0 -0
- package/src/assets/textures/ad_bolt.png +0 -0
- package/src/assets/textures/ad_bubbles.png +0 -0
- package/src/assets/textures/ad_chevrons.png +0 -0
- package/src/assets/textures/asphalt.png +0 -0
- package/src/assets/textures/bark.jpg +0 -0
- package/src/assets/textures/explorer-atlas.png +0 -0
- package/src/assets/textures/facade.png +0 -0
- package/src/assets/textures/grass.png +0 -0
- package/src/assets/textures/leaves.png +0 -0
- package/src/assets/textures/limestone.jpg +0 -0
- package/src/assets/textures/meadow.jpg +0 -0
- package/src/assets/textures/nature-sources.json +87 -0
- package/src/assets/textures/pine.png +0 -0
- package/src/assets/textures/river.jpg +0 -0
- package/src/assets/textures/soft_glow.png +0 -0
- package/src/games/arrows/Arrows.tsx +69 -0
- package/src/games/arrows/ArrowsConstants.ts +107 -0
- package/src/games/arrows/ArrowsGame.ts +735 -0
- package/src/games/arrows/ArrowsScene.ts +395 -0
- package/src/games/balloon-blaster/BalloonBlaster.tsx +75 -0
- package/src/games/balloon-blaster/BalloonBlasterConstants.ts +79 -0
- package/src/games/balloon-blaster/BalloonBlasterGame.ts +287 -0
- package/src/games/balloon-blaster/BalloonBlasterPhysics.ts +95 -0
- package/src/games/balloon-blaster/BalloonBlasterScene.ts +225 -0
- package/src/games/bike-racing/BikeMeshes.ts +273 -0
- package/src/games/bike-racing/BikeRacing.tsx +211 -0
- package/src/games/bike-racing/BikeRacingConstants.ts +103 -0
- package/src/games/bike-racing/BikeRacingGame.ts +557 -0
- package/src/games/bike-racing/BikeRacingScene.ts +119 -0
- package/src/games/block-blast/BlockBlast.tsx +73 -0
- package/src/games/block-blast/BlockBlastConstants.ts +179 -0
- package/src/games/block-blast/BlockBlastGame.ts +471 -0
- package/src/games/block-blast/BlockBlastScene.ts +156 -0
- package/src/games/block-breaker/BlockBreaker.tsx +79 -0
- package/src/games/block-breaker/BlockBreakerConstants.ts +139 -0
- package/src/games/block-breaker/BlockBreakerGame.ts +459 -0
- package/src/games/block-breaker/BlockBreakerScene.ts +257 -0
- package/src/games/bluk/Bluk.tsx +82 -0
- package/src/games/bluk/BlukConstants.ts +121 -0
- package/src/games/bluk/BlukGame.ts +323 -0
- package/src/games/bluk/BlukRules.ts +154 -0
- package/src/games/bluk/BlukScene.ts +514 -0
- package/src/games/bubble-shooter/BubbleShooter.tsx +76 -0
- package/src/games/bubble-shooter/BubbleShooterConstants.ts +103 -0
- package/src/games/bubble-shooter/BubbleShooterGame.ts +459 -0
- package/src/games/bubble-shooter/BubbleShooterScene.ts +158 -0
- package/src/games/candy-crush/CandyCrush.tsx +77 -0
- package/src/games/candy-crush/CandyCrushConstants.ts +94 -0
- package/src/games/candy-crush/CandyCrushGame.ts +477 -0
- package/src/games/candy-crush/CandyCrushScene.ts +209 -0
- package/src/games/car-racing/CarMeshes.ts +440 -0
- package/src/games/car-racing/CarRacing.tsx +211 -0
- package/src/games/car-racing/CarRacingConstants.ts +167 -0
- package/src/games/car-racing/CarRacingFacade.ts +40 -0
- package/src/games/car-racing/CarRacingGame.ts +539 -0
- package/src/games/car-racing/CarRacingScene.ts +1026 -0
- package/src/games/car-racing/CarRacingScenery.ts +265 -0
- package/src/games/chameleon-run/ChameleonRun.tsx +96 -0
- package/src/games/chameleon-run/ChameleonRunBackdrop.ts +186 -0
- package/src/games/chameleon-run/ChameleonRunConstants.ts +47 -0
- package/src/games/chameleon-run/ChameleonRunGame.ts +309 -0
- package/src/games/chameleon-run/ChameleonRunMeshes.ts +305 -0
- package/src/games/chameleon-run/ChameleonRunRules.ts +252 -0
- package/src/games/chameleon-run/ChameleonRunScene.ts +310 -0
- package/src/games/checkers/Checkers.tsx +83 -0
- package/src/games/checkers/CheckersAI.ts +255 -0
- package/src/games/checkers/CheckersConstants.ts +68 -0
- package/src/games/checkers/CheckersGame.ts +322 -0
- package/src/games/checkers/CheckersRules.ts +167 -0
- package/src/games/checkers/CheckersScene.ts +308 -0
- package/src/games/color-switch/ColorSwitch.tsx +75 -0
- package/src/games/color-switch/ColorSwitchConstants.ts +61 -0
- package/src/games/color-switch/ColorSwitchGame.ts +329 -0
- package/src/games/color-switch/ColorSwitchScene.ts +220 -0
- package/src/games/colors-sort/ColorsSort.tsx +82 -0
- package/src/games/colors-sort/ColorsSortConstants.ts +119 -0
- package/src/games/colors-sort/ColorsSortGame.ts +246 -0
- package/src/games/colors-sort/ColorsSortScene.ts +315 -0
- package/src/games/connect-em-all/ConnectEmAll.tsx +70 -0
- package/src/games/connect-em-all/ConnectEmAllConstants.ts +77 -0
- package/src/games/connect-em-all/ConnectEmAllGame.ts +401 -0
- package/src/games/connect-em-all/ConnectEmAllScene.ts +235 -0
- package/src/games/crossy-road/CrossyRoad.tsx +74 -0
- package/src/games/crossy-road/CrossyRoadCamera.ts +59 -0
- package/src/games/crossy-road/CrossyRoadConstants.ts +132 -0
- package/src/games/crossy-road/CrossyRoadGame.ts +293 -0
- package/src/games/crossy-road/CrossyRoadMeshes.ts +195 -0
- package/src/games/crossy-road/CrossyRoadPerson.ts +198 -0
- package/src/games/crossy-road/CrossyRoadRules.ts +99 -0
- package/src/games/crossy-road/CrossyRoadScene.ts +355 -0
- package/src/games/dino-jump/DinoJump.tsx +77 -0
- package/src/games/dino-jump/DinoJumpConstants.ts +80 -0
- package/src/games/dino-jump/DinoJumpGame.ts +344 -0
- package/src/games/dino-jump/DinoJumpScene.ts +686 -0
- package/src/games/dots-and-boxes/DotsAndBoxes.tsx +83 -0
- package/src/games/dots-and-boxes/DotsAndBoxesConstants.ts +77 -0
- package/src/games/dots-and-boxes/DotsAndBoxesGame.ts +271 -0
- package/src/games/dots-and-boxes/DotsAndBoxesScene.ts +249 -0
- package/src/games/falling-sticks/FallingSticks.tsx +72 -0
- package/src/games/falling-sticks/FallingSticksConstants.ts +62 -0
- package/src/games/falling-sticks/FallingSticksGame.ts +220 -0
- package/src/games/falling-sticks/FallingSticksRules.ts +145 -0
- package/src/games/falling-sticks/FallingSticksScene.ts +245 -0
- package/src/games/find-different-number/FindDifferentNumber.tsx +74 -0
- package/src/games/find-different-number/FindDifferentNumberConstants.ts +74 -0
- package/src/games/find-different-number/FindDifferentNumberGame.ts +174 -0
- package/src/games/find-different-number/FindDifferentNumberRules.ts +43 -0
- package/src/games/find-different-number/FindDifferentNumberScene.ts +193 -0
- package/src/games/flappy-bird/FlappyBird.tsx +73 -0
- package/src/games/flappy-bird/FlappyBirdConstants.ts +95 -0
- package/src/games/flappy-bird/FlappyBirdGame.ts +375 -0
- package/src/games/flappy-bird/FlappyBirdScene.ts +630 -0
- package/src/games/fruit-merger/FruitMerger.tsx +73 -0
- package/src/games/fruit-merger/FruitMergerConstants.ts +102 -0
- package/src/games/fruit-merger/FruitMergerGame.ts +285 -0
- package/src/games/fruit-merger/FruitMergerRules.ts +286 -0
- package/src/games/fruit-merger/FruitMergerScene.ts +498 -0
- package/src/games/fruit-ninja/FruitNinja.tsx +129 -0
- package/src/games/fruit-ninja/FruitNinjaConstants.ts +107 -0
- package/src/games/fruit-ninja/FruitNinjaGame.ts +391 -0
- package/src/games/fruit-ninja/FruitNinjaScene.ts +319 -0
- package/src/games/fruit-ninja/FruitNinjaWorld.ts +17 -0
- package/src/games/game-2048/Game2048.tsx +84 -0
- package/src/games/game-2048/Game2048Constants.ts +68 -0
- package/src/games/game-2048/Game2048Game.ts +181 -0
- package/src/games/game-2048/Game2048Rules.ts +101 -0
- package/src/games/game-2048/Game2048Scene.ts +206 -0
- package/src/games/knife-hit/KnifeHit.tsx +78 -0
- package/src/games/knife-hit/KnifeHitConstants.ts +89 -0
- package/src/games/knife-hit/KnifeHitGame.ts +264 -0
- package/src/games/knife-hit/KnifeHitScene.ts +360 -0
- package/src/games/ludo-king/LudoKing.tsx +86 -0
- package/src/games/ludo-king/LudoKingConstants.ts +212 -0
- package/src/games/ludo-king/LudoKingGame.ts +326 -0
- package/src/games/ludo-king/LudoKingRules.ts +143 -0
- package/src/games/ludo-king/LudoKingScene.ts +397 -0
- package/src/games/maze-runner/MazeRunner.tsx +88 -0
- package/src/games/maze-runner/MazeRunnerConstants.ts +65 -0
- package/src/games/maze-runner/MazeRunnerGame.ts +176 -0
- package/src/games/maze-runner/MazeRunnerRules.ts +161 -0
- package/src/games/maze-runner/MazeRunnerScene.ts +245 -0
- package/src/games/memory-match/MemoryMatch.tsx +77 -0
- package/src/games/memory-match/MemoryMatchConstants.ts +105 -0
- package/src/games/memory-match/MemoryMatchGame.ts +222 -0
- package/src/games/memory-match/MemoryMatchRules.ts +38 -0
- package/src/games/memory-match/MemoryMatchScene.ts +268 -0
- package/src/games/mine-sweeper/MineSweeper.tsx +77 -0
- package/src/games/mine-sweeper/MineSweeperConstants.ts +94 -0
- package/src/games/mine-sweeper/MineSweeperGame.ts +234 -0
- package/src/games/mine-sweeper/MineSweeperRules.ts +67 -0
- package/src/games/mine-sweeper/MineSweeperScene.ts +262 -0
- package/src/games/mob-control/MobControl.tsx +73 -0
- package/src/games/mob-control/MobControlConstants.ts +106 -0
- package/src/games/mob-control/MobControlGame.ts +176 -0
- package/src/games/mob-control/MobControlMeshes.ts +85 -0
- package/src/games/mob-control/MobControlRenderer.ts +108 -0
- package/src/games/mob-control/MobControlRules.ts +522 -0
- package/src/games/mob-control/MobControlScene.ts +399 -0
- package/src/games/number-search/NumberSearch.tsx +18 -0
- package/src/games/number-search/NumberSearchNumbers.ts +623 -0
- package/src/games/nuts-and-bolts/NutsAndBolts.tsx +85 -0
- package/src/games/nuts-and-bolts/NutsAndBoltsConstants.ts +75 -0
- package/src/games/nuts-and-bolts/NutsAndBoltsGame.ts +298 -0
- package/src/games/nuts-and-bolts/NutsAndBoltsRules.ts +474 -0
- package/src/games/nuts-and-bolts/NutsAndBoltsScene.ts +498 -0
- package/src/games/pac-man/PacMan.tsx +86 -0
- package/src/games/pac-man/PacManConstants.ts +169 -0
- package/src/games/pac-man/PacManGame.ts +406 -0
- package/src/games/pac-man/PacManRules.ts +255 -0
- package/src/games/pac-man/PacManScene.ts +387 -0
- package/src/games/paper-io/PaperIo.tsx +91 -0
- package/src/games/paper-io/PaperIoConstants.ts +86 -0
- package/src/games/paper-io/PaperIoGame.ts +193 -0
- package/src/games/paper-io/PaperIoMeshes.ts +233 -0
- package/src/games/paper-io/PaperIoRules.ts +315 -0
- package/src/games/paper-io/PaperIoScene.ts +310 -0
- package/src/games/penguin-run/PenguinMeshes.ts +269 -0
- package/src/games/penguin-run/PenguinModel.ts +712 -0
- package/src/games/penguin-run/PenguinRun.tsx +77 -0
- package/src/games/penguin-run/PenguinRunConstants.ts +69 -0
- package/src/games/penguin-run/PenguinRunGame.ts +406 -0
- package/src/games/penguin-run/PenguinRunScene.ts +949 -0
- package/src/games/perfect-circle/PerfectCircle.tsx +74 -0
- package/src/games/perfect-circle/PerfectCircleConstants.ts +52 -0
- package/src/games/perfect-circle/PerfectCircleGame.ts +153 -0
- package/src/games/perfect-circle/PerfectCircleRules.ts +111 -0
- package/src/games/perfect-circle/PerfectCircleScene.ts +176 -0
- package/src/games/pipe-connect/PipeConnect.tsx +69 -0
- package/src/games/pipe-connect/PipeConnectConstants.ts +101 -0
- package/src/games/pipe-connect/PipeConnectGame.ts +179 -0
- package/src/games/pipe-connect/PipeConnectRules.ts +326 -0
- package/src/games/pipe-connect/PipeConnectScene.ts +271 -0
- package/src/games/play-with-tua/PlayWithTua.tsx +123 -0
- package/src/games/play-with-tua/PlayWithTuaConstants.ts +70 -0
- package/src/games/play-with-tua/PlayWithTuaGame.ts +167 -0
- package/src/games/play-with-tua/PlayWithTuaModel.ts +42 -0
- package/src/games/play-with-tua/PlayWithTuaScene.ts +36 -0
- package/src/games/popit-fidget/PopitFidget.tsx +72 -0
- package/src/games/popit-fidget/PopitFidgetConstants.ts +71 -0
- package/src/games/popit-fidget/PopitFidgetGame.ts +148 -0
- package/src/games/popit-fidget/PopitFidgetScene.ts +242 -0
- package/src/games/reversi/Reversi.tsx +94 -0
- package/src/games/reversi/ReversiConstants.ts +67 -0
- package/src/games/reversi/ReversiGame.ts +266 -0
- package/src/games/reversi/ReversiRules.ts +176 -0
- package/src/games/reversi/ReversiScene.ts +240 -0
- package/src/games/search-grid/SearchGrid.tsx +92 -0
- package/src/games/search-grid/SearchGridConstants.ts +178 -0
- package/src/games/search-grid/SearchGridGame.ts +209 -0
- package/src/games/search-grid/SearchGridScene.ts +301 -0
- package/src/games/shared/BackdropCard.tsx +54 -0
- package/src/games/shared/EngineBackdrop.ts +300 -0
- package/src/games/shared/EngineBlasts.ts +136 -0
- package/src/games/shared/EngineBlocks.ts +91 -0
- package/src/games/shared/EngineControlText.ts +17 -0
- package/src/games/shared/EngineDice.ts +250 -0
- package/src/games/shared/EngineFootprint.ts +35 -0
- package/src/games/shared/EngineFruits.ts +1435 -0
- package/src/games/shared/EngineGameLoader.tsx +88 -0
- package/src/games/shared/EngineGameScreen.tsx +325 -0
- package/src/games/shared/EngineGameWidth.ts +3 -0
- package/src/games/shared/EngineGameWidth.web.ts +3 -0
- package/src/games/shared/EngineGlyphs.ts +178 -0
- package/src/games/shared/EngineHud.ts +815 -0
- package/src/games/shared/EngineLoading.ts +477 -0
- package/src/games/shared/EngineMeadow.ts +725 -0
- package/src/games/shared/EngineMeshCache.ts +15 -0
- package/src/games/shared/EngineMeshes.ts +10 -0
- package/src/games/shared/EngineRacingChase.ts +21 -0
- package/src/games/shared/EngineRacingHandling.ts +48 -0
- package/src/games/shared/EngineReadyContext.ts +4 -0
- package/src/games/shared/EngineTilt.ts +44 -0
- package/src/games/shared/EngineTouchSurface.tsx +103 -0
- package/src/games/shared/EngineUtils.ts +52 -0
- package/src/games/shared/GameActivity.ts +13 -0
- package/src/games/shared/GameLoading.tsx +202 -0
- package/src/games/shared/GameLoadingTransition.tsx +61 -0
- package/src/games/shared/ProceduralCacheVersion.ts +2 -0
- package/src/games/shared/useEngineGame.ts +240 -0
- package/src/games/shared/useGameResource.ts +21 -0
- package/src/games/shared/useLiveState.ts +58 -0
- package/src/games/sliding-numbers/SlidingNumbers.tsx +71 -0
- package/src/games/sliding-numbers/SlidingNumbersConstants.ts +65 -0
- package/src/games/sliding-numbers/SlidingNumbersGame.ts +192 -0
- package/src/games/sliding-numbers/SlidingNumbersRules.ts +79 -0
- package/src/games/sliding-numbers/SlidingNumbersScene.ts +193 -0
- package/src/games/snake-3d/Snake3D.tsx +76 -0
- package/src/games/snake-3d/Snake3DConstants.ts +61 -0
- package/src/games/snake-3d/Snake3DGame.ts +192 -0
- package/src/games/snake-3d/Snake3DMotion.ts +22 -0
- package/src/games/snake-3d/Snake3DRules.ts +116 -0
- package/src/games/snake-3d/Snake3DScene.ts +322 -0
- package/src/games/snakes-and-ladders/SnakesAndLadders.tsx +87 -0
- package/src/games/snakes-and-ladders/SnakesAndLaddersConstants.ts +136 -0
- package/src/games/snakes-and-ladders/SnakesAndLaddersGame.ts +310 -0
- package/src/games/snakes-and-ladders/SnakesAndLaddersScene.ts +515 -0
- package/src/games/space-fighter/SpaceFighter.tsx +74 -0
- package/src/games/space-fighter/SpaceFighterConstants.ts +86 -0
- package/src/games/space-fighter/SpaceFighterGame.ts +292 -0
- package/src/games/space-fighter/SpaceFighterScene.ts +550 -0
- package/src/games/spider-solitaire/SpiderSolitaire.tsx +80 -0
- package/src/games/spider-solitaire/SpiderSolitaireConstants.ts +107 -0
- package/src/games/spider-solitaire/SpiderSolitaireGame.ts +387 -0
- package/src/games/spider-solitaire/SpiderSolitaireRules.ts +123 -0
- package/src/games/spider-solitaire/SpiderSolitaireScene.ts +352 -0
- package/src/games/stack-tower/StackTower.tsx +76 -0
- package/src/games/stack-tower/StackTowerConstants.ts +74 -0
- package/src/games/stack-tower/StackTowerGame.ts +236 -0
- package/src/games/stack-tower/StackTowerScene.ts +186 -0
- package/src/games/sudoku/Sudoku.tsx +73 -0
- package/src/games/sudoku/SudokuConstants.ts +127 -0
- package/src/games/sudoku/SudokuGame.ts +250 -0
- package/src/games/sudoku/SudokuRules.ts +125 -0
- package/src/games/sudoku/SudokuScene.ts +304 -0
- package/src/games/tangram/Tangram.tsx +79 -0
- package/src/games/tangram/TangramConstants.ts +64 -0
- package/src/games/tangram/TangramGame.ts +356 -0
- package/src/games/tangram/TangramRules.ts +409 -0
- package/src/games/tangram/TangramScene.ts +203 -0
- package/src/games/tank-1990/Tank1990.tsx +78 -0
- package/src/games/tank-1990/Tank1990Constants.ts +81 -0
- package/src/games/tank-1990/Tank1990Game.ts +331 -0
- package/src/games/tank-1990/Tank1990Rules.ts +390 -0
- package/src/games/tank-1990/Tank1990Scene.ts +434 -0
- package/src/games/tic-tac-toe/TicTacToe.tsx +98 -0
- package/src/games/tic-tac-toe/TicTacToeConstants.ts +69 -0
- package/src/games/tic-tac-toe/TicTacToeGame.ts +200 -0
- package/src/games/tic-tac-toe/TicTacToeRules.ts +103 -0
- package/src/games/tic-tac-toe/TicTacToeScene.ts +245 -0
- package/src/games/tile-home/TileHome.tsx +92 -0
- package/src/games/tile-home/TileHomeConstants.ts +139 -0
- package/src/games/tile-home/TileHomeGame.ts +435 -0
- package/src/games/tile-home/TileHomeScene.ts +154 -0
- package/src/games/treasure-hunt/TreasureHunt.tsx +206 -0
- package/src/games/treasure-hunt/TreasureHuntConstants.ts +266 -0
- package/src/games/treasure-hunt/TreasureHuntControls.ts +280 -0
- package/src/games/treasure-hunt/TreasureHuntGame.ts +402 -0
- package/src/games/treasure-hunt/TreasureHuntMeshes.ts +422 -0
- package/src/games/treasure-hunt/TreasureHuntModel.ts +506 -0
- package/src/games/treasure-hunt/TreasureHuntRules.ts +1210 -0
- package/src/games/treasure-hunt/TreasureHuntScene.ts +586 -0
- package/src/games/whack-a-mole/WhackAMole.tsx +79 -0
- package/src/games/whack-a-mole/WhackAMoleConstants.ts +94 -0
- package/src/games/whack-a-mole/WhackAMoleGame.ts +233 -0
- package/src/games/whack-a-mole/WhackAMoleScene.ts +349 -0
- package/src/games/word-search/WordSearch.tsx +18 -0
- package/src/games/word-search/WordSearchWords.ts +1642 -0
- package/src/helpers/GamePatternData.ts +120 -0
- package/src/helpers/GameSettingsModal.tsx +384 -0
- package/src/helpers/GameTheme.tsx +37 -0
- package/src/helpers/IconPaths.ts +6 -0
- package/src/helpers/index.ts +2 -0
- package/src/index.tsx +60 -0
- package/src/services/GameAssetLoader.ts +111 -0
- package/src/services/GameAssets.ts +149 -0
- package/src/services/GameLoaders.ts +93 -0
- package/src/services/GamesConstants.ts +193 -0
- package/src/services/GamesMetadata.ts +711 -0
- package/src/services/GamesService.ts +116 -0
- package/src/services/HapticsService.ts +48 -0
- package/src/services/ScoringService.ts +19 -0
- package/src/services/SfxSources.ts +81 -0
- package/src/services/SoundsService.ts +582 -0
- package/src/services/ThemeService.ts +281 -0
- package/src/services/UtilsService.ts +134 -0
- package/src/services/index.ts +6 -0
- package/lib/module/games/arrows/ArrowsService.js +0 -1
- package/lib/module/games/arrows/ArrowsStore.js +0 -1
- package/lib/module/games/arrows/components/ArrowsGrid.js +0 -1
- package/lib/module/games/arrows/components/ScoreBoard.js +0 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +0 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +0 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +0 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +0 -1
- package/lib/module/games/balloon-blaster/components/GameBackground.js +0 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +0 -1
- package/lib/module/games/bike-racing/BikeRacingService.js +0 -1
- package/lib/module/games/bike-racing/BikeRacingStore.js +0 -1
- package/lib/module/games/bike-racing/components/BikeComponent.js +0 -1
- package/lib/module/games/bike-racing/components/GameBackground.js +0 -1
- package/lib/module/games/bike-racing/components/ScoreBoard.js +0 -1
- package/lib/module/games/block-blast/BlockBlastService.js +0 -1
- package/lib/module/games/block-blast/BlockBlastStore.js +0 -1
- package/lib/module/games/block-blast/components/BlockPieceComponent.js +0 -1
- package/lib/module/games/block-blast/components/GameArea.js +0 -1
- package/lib/module/games/block-blast/components/GridComponent.js +0 -1
- package/lib/module/games/block-blast/components/ScoreBoard.js +0 -1
- package/lib/module/games/block-breaker/BlockBreakerService.js +0 -1
- package/lib/module/games/block-breaker/BlockBreakerStore.js +0 -1
- package/lib/module/games/block-breaker/components/BlastAnimation.js +0 -1
- package/lib/module/games/block-breaker/components/GameArea.js +0 -1
- package/lib/module/games/block-breaker/components/ScoreBoard.js +0 -1
- package/lib/module/games/bluk/BlukService.js +0 -1
- package/lib/module/games/bluk/BlukStore.js +0 -1
- package/lib/module/games/bluk/components/GameArea.js +0 -1
- package/lib/module/games/bluk/components/GameBackground.js +0 -1
- package/lib/module/games/bluk/components/ScoreBoard.js +0 -1
- package/lib/module/games/bubble-shooter/BubbleShooterService.js +0 -1
- package/lib/module/games/bubble-shooter/BubbleShooterStore.js +0 -1
- package/lib/module/games/bubble-shooter/components/GameArea.js +0 -1
- package/lib/module/games/bubble-shooter/components/ScoreBoard.js +0 -1
- package/lib/module/games/candy-crush/CandyCrushService.js +0 -1
- package/lib/module/games/candy-crush/CandyCrushStore.js +0 -1
- package/lib/module/games/candy-crush/components/CandyItem.js +0 -1
- package/lib/module/games/candy-crush/components/GameGrid.js +0 -1
- package/lib/module/games/candy-crush/components/ScoreBoard.js +0 -1
- package/lib/module/games/car-racing/CarRacingService.js +0 -1
- package/lib/module/games/car-racing/CarRacingStore.js +0 -1
- package/lib/module/games/car-racing/components/CarComponent.js +0 -1
- package/lib/module/games/car-racing/components/GameBackground.js +0 -1
- package/lib/module/games/car-racing/components/ScoreBoard.js +0 -1
- package/lib/module/games/chameleon-run/ChameleonRunService.js +0 -1
- package/lib/module/games/chameleon-run/ChameleonRunStore.js +0 -1
- package/lib/module/games/chameleon-run/components/GameArea.js +0 -1
- package/lib/module/games/chameleon-run/components/GameBackground.js +0 -1
- package/lib/module/games/chameleon-run/components/ScoreBoard.js +0 -1
- package/lib/module/games/checkers/CheckersService.js +0 -1
- package/lib/module/games/checkers/CheckersStore.js +0 -1
- package/lib/module/games/checkers/components/GameBoard.js +0 -1
- package/lib/module/games/checkers/components/ScoreBoard.js +0 -1
- package/lib/module/games/color-switch/ColorSwitchService.js +0 -1
- package/lib/module/games/color-switch/ColorSwitchStore.js +0 -1
- package/lib/module/games/color-switch/components/GameArea.js +0 -1
- package/lib/module/games/color-switch/components/ScoreBoard.js +0 -1
- package/lib/module/games/colors-sort/ColorsSortService.js +0 -1
- package/lib/module/games/colors-sort/ColorsSortStore.js +0 -1
- package/lib/module/games/colors-sort/components/ColorContainer.js +0 -1
- package/lib/module/games/colors-sort/components/ScoreBoard.js +0 -1
- package/lib/module/games/connect-em-all/ConnectEmAllService.js +0 -1
- package/lib/module/games/connect-em-all/ConnectEmAllStore.js +0 -1
- package/lib/module/games/connect-em-all/components/GameBoard.js +0 -1
- package/lib/module/games/connect-em-all/components/ScoreBoard.js +0 -1
- package/lib/module/games/crossy-road/CrossyRoadService.js +0 -1
- package/lib/module/games/crossy-road/CrossyRoadStore.js +0 -1
- package/lib/module/games/crossy-road/components/GameArea.js +0 -1
- package/lib/module/games/crossy-road/components/ScoreBoard.js +0 -1
- package/lib/module/games/dino-jump/DinoJumpService.js +0 -1
- package/lib/module/games/dino-jump/DinoJumpStore.js +0 -1
- package/lib/module/games/dino-jump/components/DinoSprite.js +0 -1
- package/lib/module/games/dino-jump/components/GameArea.js +0 -1
- package/lib/module/games/dino-jump/components/GameBackground.js +0 -1
- package/lib/module/games/dino-jump/components/ObstacleSprite.js +0 -1
- package/lib/module/games/dino-jump/components/ScoreBoard.js +0 -1
- package/lib/module/games/dino-jump/components/StarSprite.js +0 -1
- package/lib/module/games/dots-and-boxes/DotsAndBoxesService.js +0 -1
- package/lib/module/games/dots-and-boxes/DotsAndBoxesStore.js +0 -1
- package/lib/module/games/dots-and-boxes/components/GameBoard.js +0 -1
- package/lib/module/games/dots-and-boxes/components/ScoreBoard.js +0 -1
- package/lib/module/games/falling-sticks/FallingSticksService.js +0 -1
- package/lib/module/games/falling-sticks/FallingSticksStore.js +0 -1
- package/lib/module/games/falling-sticks/components/GameArea.js +0 -1
- package/lib/module/games/falling-sticks/components/GameBackground.js +0 -1
- package/lib/module/games/falling-sticks/components/ScoreBoard.js +0 -1
- package/lib/module/games/find-different-number/FindDifferentNumberService.js +0 -1
- package/lib/module/games/find-different-number/FindDifferentNumberStore.js +0 -1
- package/lib/module/games/find-different-number/components/GameGrid.js +0 -1
- package/lib/module/games/find-different-number/components/ScoreBoard.js +0 -1
- package/lib/module/games/flappy-bird/FlappyBirdStore.js +0 -1
- package/lib/module/games/flappy-bird/components/Bird.js +0 -1
- package/lib/module/games/flappy-bird/components/GameArea.js +0 -1
- package/lib/module/games/flappy-bird/components/GameBackground.js +0 -1
- package/lib/module/games/flappy-bird/components/Pipes.js +0 -1
- package/lib/module/games/flappy-bird/components/ScoreBoard.js +0 -1
- package/lib/module/games/fruit-merger/FruitMergerService.js +0 -1
- package/lib/module/games/fruit-merger/FruitMergerStore.js +0 -1
- package/lib/module/games/fruit-merger/components/FruitItem.js +0 -1
- package/lib/module/games/fruit-merger/components/GameArea.js +0 -1
- package/lib/module/games/fruit-merger/components/ScoreBoard.js +0 -1
- package/lib/module/games/fruit-ninja/FruitNinjaService.js +0 -1
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +0 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js +0 -1
- package/lib/module/games/fruit-ninja/components/GameArea.js +0 -1
- package/lib/module/games/fruit-ninja/components/GameBackground.js +0 -1
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js +0 -1
- package/lib/module/games/game-2048/Game2048Service.js +0 -1
- package/lib/module/games/game-2048/Game2048Store.js +0 -1
- package/lib/module/games/game-2048/components/GameGrid.js +0 -1
- package/lib/module/games/game-2048/components/ScoreBoard.js +0 -1
- package/lib/module/games/knife-hit/KnifeHitService.js +0 -1
- package/lib/module/games/knife-hit/KnifeHitStore.js +0 -1
- package/lib/module/games/knife-hit/components/GameArea.js +0 -1
- package/lib/module/games/knife-hit/components/ScoreBoard.js +0 -1
- package/lib/module/games/ludo-king/LudoKingService.js +0 -1
- package/lib/module/games/ludo-king/LudoKingStore.js +0 -1
- package/lib/module/games/ludo-king/components/Dice.js +0 -1
- package/lib/module/games/ludo-king/components/GameBoard.js +0 -1
- package/lib/module/games/ludo-king/components/ScoreBoard.js +0 -1
- package/lib/module/games/maze-runner/MazeRunnerStore.js +0 -1
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +0 -1
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +0 -1
- package/lib/module/games/maze-runner/components/ScoreBoard.js +0 -1
- package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +0 -1
- package/lib/module/games/maze-runner/components/WallComponent.js +0 -1
- package/lib/module/games/memory-match/MemoryMatchService.js +0 -1
- package/lib/module/games/memory-match/MemoryMatchStore.js +0 -1
- package/lib/module/games/memory-match/components/Card.js +0 -1
- package/lib/module/games/memory-match/components/GameBoard.js +0 -1
- package/lib/module/games/memory-match/components/ScoreBoard.js +0 -1
- package/lib/module/games/mine-sweeper/MineSweeperService.js +0 -1
- package/lib/module/games/mine-sweeper/MineSweeperStore.js +0 -1
- package/lib/module/games/mine-sweeper/components/GameArea.js +0 -1
- package/lib/module/games/mine-sweeper/components/ScoreBoard.js +0 -1
- package/lib/module/games/mob-control/MobControlService.js +0 -1
- package/lib/module/games/mob-control/MobControlStore.js +0 -1
- package/lib/module/games/mob-control/components/GameArea.js +0 -1
- package/lib/module/games/mob-control/components/ScoreBoard.js +0 -1
- package/lib/module/games/number-search/NumberSearchConstants.js +0 -1
- package/lib/module/games/number-search/NumberSearchService.js +0 -1
- package/lib/module/games/number-search/NumberSearchStore.js +0 -1
- package/lib/module/games/number-search/components/GameBoard.js +0 -1
- package/lib/module/games/number-search/components/NumberList.js +0 -1
- package/lib/module/games/number-search/components/ScoreBoard.js +0 -1
- package/lib/module/games/nuts-and-bolts/NutsAndBoltsService.js +0 -1
- package/lib/module/games/nuts-and-bolts/NutsAndBoltsStore.js +0 -1
- package/lib/module/games/nuts-and-bolts/components/GameBoard.js +0 -1
- package/lib/module/games/nuts-and-bolts/components/ScoreBoard.js +0 -1
- package/lib/module/games/pac-man/PacManService.js +0 -1
- package/lib/module/games/pac-man/PacManStore.js +0 -1
- package/lib/module/games/pac-man/components/GameCanvas.js +0 -1
- package/lib/module/games/pac-man/components/ScoreBoard.js +0 -1
- package/lib/module/games/paper-io/PaperIoService.js +0 -1
- package/lib/module/games/paper-io/PaperIoStore.js +0 -1
- package/lib/module/games/paper-io/components/GameArea.js +0 -1
- package/lib/module/games/paper-io/components/ScoreBoard.js +0 -1
- package/lib/module/games/perfect-circle/PerfectCircleService.js +0 -1
- package/lib/module/games/perfect-circle/PerfectCircleStore.js +0 -1
- package/lib/module/games/perfect-circle/components/DrawingCanvas.js +0 -1
- package/lib/module/games/perfect-circle/components/ScoreBoard.js +0 -1
- package/lib/module/games/pipe-connect/PipeConnectService.js +0 -1
- package/lib/module/games/pipe-connect/PipeConnectStore.js +0 -1
- package/lib/module/games/pipe-connect/components/GameArea.js +0 -1
- package/lib/module/games/pipe-connect/components/ScoreBoard.js +0 -1
- package/lib/module/games/popit-fidget/PopitFidgetService.js +0 -1
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +0 -1
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +0 -1
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +0 -1
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +0 -1
- package/lib/module/games/reversi/ReversiStore.js +0 -1
- package/lib/module/games/reversi/components/GameBoard.js +0 -1
- package/lib/module/games/reversi/components/ScoreBoard.js +0 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersService.js +0 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +0 -1
- package/lib/module/games/sliding-numbers/components/NumbersGrid.js +0 -1
- package/lib/module/games/sliding-numbers/components/ScoreBoard.js +0 -1
- package/lib/module/games/snake-3d/Snake3DService.js +0 -1
- package/lib/module/games/snake-3d/Snake3DStore.js +0 -1
- package/lib/module/games/snake-3d/components/GameGrid.js +0 -1
- package/lib/module/games/snake-3d/components/ScoreBoard.js +0 -1
- package/lib/module/games/snakes-and-ladders/SnakesAndLaddersService.js +0 -1
- package/lib/module/games/snakes-and-ladders/SnakesAndLaddersStore.js +0 -1
- package/lib/module/games/snakes-and-ladders/components/Dice.js +0 -1
- package/lib/module/games/snakes-and-ladders/components/GameBoard.js +0 -1
- package/lib/module/games/snakes-and-ladders/components/ScoreBoard.js +0 -1
- package/lib/module/games/space-fighter/SpaceFighterService.js +0 -1
- package/lib/module/games/space-fighter/SpaceFighterStore.js +0 -1
- package/lib/module/games/space-fighter/components/AsteroidComponent.js +0 -1
- package/lib/module/games/space-fighter/components/GameArea.js +0 -1
- package/lib/module/games/space-fighter/components/GameBackground.js +0 -1
- package/lib/module/games/space-fighter/components/ScoreBoard.js +0 -1
- package/lib/module/games/space-fighter/components/Spacecraft3D.js +0 -1
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +0 -1
- package/lib/module/games/spider-solitaire/SpiderSolitaireService.js +0 -1
- package/lib/module/games/spider-solitaire/SpiderSolitaireStore.js +0 -1
- package/lib/module/games/spider-solitaire/components/Card.js +0 -1
- package/lib/module/games/spider-solitaire/components/CardPile.js +0 -1
- package/lib/module/games/spider-solitaire/components/ScoreBoard.js +0 -1
- package/lib/module/games/stack-tower/StackTowerService.js +0 -1
- package/lib/module/games/stack-tower/StackTowerStore.js +0 -1
- package/lib/module/games/stack-tower/components/GameArea.js +0 -1
- package/lib/module/games/stack-tower/components/ScoreBoard.js +0 -1
- package/lib/module/games/sudoku/SudokuService.js +0 -1
- package/lib/module/games/sudoku/SudokuStore.js +0 -1
- package/lib/module/games/sudoku/components/GameArea.js +0 -1
- package/lib/module/games/sudoku/components/ScoreBoard.js +0 -1
- package/lib/module/games/tangram/TangramService.js +0 -1
- package/lib/module/games/tangram/TangramStore.js +0 -1
- package/lib/module/games/tangram/components/GameBoard.js +0 -1
- package/lib/module/games/tangram/components/ScoreBoard.js +0 -1
- package/lib/module/games/tank-1990/Tank1990Service.js +0 -1
- package/lib/module/games/tank-1990/Tank1990Store.js +0 -1
- package/lib/module/games/tank-1990/components/Controls.js +0 -1
- package/lib/module/games/tank-1990/components/GameBoard.js +0 -1
- package/lib/module/games/tank-1990/components/ScoreBoard.js +0 -1
- package/lib/module/games/tic-tac-toe/TicTacToeService.js +0 -1
- package/lib/module/games/tic-tac-toe/TicTacToeStore.js +0 -1
- package/lib/module/games/tic-tac-toe/components/GameBoard.js +0 -1
- package/lib/module/games/tic-tac-toe/components/ScoreBoard.js +0 -1
- package/lib/module/games/tile-home/TileHomeService.js +0 -1
- package/lib/module/games/tile-home/TileHomeStore.js +0 -1
- package/lib/module/games/tile-home/components/AnimatingTile.js +0 -1
- package/lib/module/games/tile-home/components/FlyingTile.js +0 -1
- package/lib/module/games/tile-home/components/GameBoard.js +0 -1
- package/lib/module/games/tile-home/components/ScoreBoard.js +0 -1
- package/lib/module/games/tile-home/components/TileItem.js +0 -1
- package/lib/module/games/tile-home/components/TileSlot.js +0 -1
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +0 -1
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +0 -1
- package/lib/module/games/whack-a-mole/components/GameBackground.js +0 -1
- package/lib/module/games/whack-a-mole/components/GameGrid.js +0 -1
- package/lib/module/games/whack-a-mole/components/GameHole.js +0 -1
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js +0 -1
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js +0 -1
- package/lib/module/games/word-search/WordSearchConstants.js +0 -1
- package/lib/module/games/word-search/WordSearchService.js +0 -1
- package/lib/module/games/word-search/WordSearchStore.js +0 -1
- package/lib/module/games/word-search/components/GameBoard.js +0 -1
- package/lib/module/games/word-search/components/ScoreBoard.js +0 -1
- package/lib/module/games/word-search/components/WordList.js +0 -1
- package/lib/module/helpers/AnimatedScore.js +0 -1
- package/lib/module/helpers/AnimationFrame.js +0 -1
- package/lib/module/helpers/AnimationTracker.js +0 -1
- package/lib/module/helpers/BlastAnimation.js +0 -1
- package/lib/module/helpers/ErrorHandler.js +0 -1
- package/lib/module/helpers/GameBackgroundPattern.js +0 -1
- package/lib/module/helpers/GameControlButton.js +0 -1
- package/lib/module/helpers/GameOverModal.js +0 -1
- package/lib/module/helpers/GameTimer.js +0 -1
- package/lib/module/helpers/Icons.js +0 -1
- package/lib/module/helpers/ParticleBlast.js +0 -1
- package/lib/module/helpers/ScoreBoardContainer.js +0 -1
- package/lib/module/helpers/assets/apple-fruit.js +0 -1
- package/lib/module/helpers/assets/avocado-item.js +0 -1
- package/lib/module/helpers/assets/banana-fruit.js +0 -1
- package/lib/module/helpers/assets/bomb-item.js +0 -1
- package/lib/module/helpers/assets/broccoli-item.js +0 -1
- package/lib/module/helpers/assets/cherries-fruit.js +0 -1
- package/lib/module/helpers/assets/donut-item.js +0 -1
- package/lib/module/helpers/assets/dragonfruit-item.js +0 -1
- package/lib/module/helpers/assets/fries-item.js +0 -1
- package/lib/module/helpers/assets/fruit-helpers.js +0 -1
- package/lib/module/helpers/assets/grapes-fruit.js +0 -1
- package/lib/module/helpers/assets/icecream-item.js +0 -1
- package/lib/module/helpers/assets/index.js +0 -1
- package/lib/module/helpers/assets/kiwi-fruit.js +0 -1
- package/lib/module/helpers/assets/mango-fruit.js +0 -1
- package/lib/module/helpers/assets/orange-fruit.js +0 -1
- package/lib/module/helpers/assets/papaya-fruit.js +0 -1
- package/lib/module/helpers/assets/papaya-full-fruit.js +0 -1
- package/lib/module/helpers/assets/peach-fruit.js +0 -1
- package/lib/module/helpers/assets/pineapple-fruit.js +0 -1
- package/lib/module/helpers/assets/pomegranate-fruit.js +0 -1
- package/lib/module/helpers/assets/pumpkin-fruit.js +0 -1
- package/lib/module/helpers/assets/raspberry-item.js +0 -1
- package/lib/module/helpers/assets/star-item.js +0 -1
- package/lib/module/helpers/assets/strawberry-fruit.js +0 -1
- package/lib/module/helpers/assets/watermelon-fruit.js +0 -1
- package/lib/module/types.d.js +0 -1
- package/lib/typescript/src/games/arrows/ArrowsService.d.ts +0 -6
- package/lib/typescript/src/games/arrows/ArrowsStore.d.ts +0 -51
- package/lib/typescript/src/games/arrows/components/ArrowsGrid.d.ts +0 -13
- package/lib/typescript/src/games/arrows/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +0 -80
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +0 -30
- package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts +0 -9
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +0 -9
- package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts +0 -44
- package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts +0 -68
- package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts +0 -12
- package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts +0 -16
- package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts +0 -70
- package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts +0 -11
- package/lib/typescript/src/games/block-blast/components/GameArea.d.ts +0 -11
- package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts +0 -8
- package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/block-breaker/BlockBreakerService.d.ts +0 -88
- package/lib/typescript/src/games/block-breaker/BlockBreakerStore.d.ts +0 -47
- package/lib/typescript/src/games/block-breaker/components/BlastAnimation.d.ts +0 -15
- package/lib/typescript/src/games/block-breaker/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/block-breaker/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/bluk/BlukService.d.ts +0 -71
- package/lib/typescript/src/games/bluk/BlukStore.d.ts +0 -52
- package/lib/typescript/src/games/bluk/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/bluk/components/GameBackground.d.ts +0 -9
- package/lib/typescript/src/games/bluk/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts +0 -35
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts +0 -63
- package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/candy-crush/CandyCrushService.d.ts +0 -37
- package/lib/typescript/src/games/candy-crush/CandyCrushStore.d.ts +0 -53
- package/lib/typescript/src/games/candy-crush/components/CandyItem.d.ts +0 -11
- package/lib/typescript/src/games/candy-crush/components/GameGrid.d.ts +0 -2
- package/lib/typescript/src/games/candy-crush/components/ScoreBoard.d.ts +0 -5
- package/lib/typescript/src/games/car-racing/CarRacingService.d.ts +0 -44
- package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts +0 -68
- package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts +0 -12
- package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/chameleon-run/ChameleonRunService.d.ts +0 -76
- package/lib/typescript/src/games/chameleon-run/ChameleonRunStore.d.ts +0 -48
- package/lib/typescript/src/games/chameleon-run/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/chameleon-run/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/chameleon-run/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/checkers/CheckersService.d.ts +0 -6
- package/lib/typescript/src/games/checkers/CheckersStore.d.ts +0 -48
- package/lib/typescript/src/games/checkers/components/GameBoard.d.ts +0 -6
- package/lib/typescript/src/games/checkers/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/color-switch/ColorSwitchService.d.ts +0 -63
- package/lib/typescript/src/games/color-switch/ColorSwitchStore.d.ts +0 -43
- package/lib/typescript/src/games/color-switch/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/color-switch/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/colors-sort/ColorsSortService.d.ts +0 -61
- package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts +0 -56
- package/lib/typescript/src/games/colors-sort/components/ColorContainer.d.ts +0 -7
- package/lib/typescript/src/games/colors-sort/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/connect-em-all/ConnectEmAllService.d.ts +0 -20
- package/lib/typescript/src/games/connect-em-all/ConnectEmAllStore.d.ts +0 -48
- package/lib/typescript/src/games/connect-em-all/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/connect-em-all/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/crossy-road/CrossyRoadService.d.ts +0 -89
- package/lib/typescript/src/games/crossy-road/CrossyRoadStore.d.ts +0 -39
- package/lib/typescript/src/games/crossy-road/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/crossy-road/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/dino-jump/DinoJumpService.d.ts +0 -39
- package/lib/typescript/src/games/dino-jump/DinoJumpStore.d.ts +0 -97
- package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts +0 -2
- package/lib/typescript/src/games/dino-jump/components/GameArea.d.ts +0 -7
- package/lib/typescript/src/games/dino-jump/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/dino-jump/components/ObstacleSprite.d.ts +0 -8
- package/lib/typescript/src/games/dino-jump/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/dino-jump/components/StarSprite.d.ts +0 -2
- package/lib/typescript/src/games/dots-and-boxes/DotsAndBoxesService.d.ts +0 -45
- package/lib/typescript/src/games/dots-and-boxes/DotsAndBoxesStore.d.ts +0 -37
- package/lib/typescript/src/games/dots-and-boxes/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/dots-and-boxes/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/falling-sticks/FallingSticksService.d.ts +0 -40
- package/lib/typescript/src/games/falling-sticks/FallingSticksStore.d.ts +0 -31
- package/lib/typescript/src/games/falling-sticks/components/GameArea.d.ts +0 -7
- package/lib/typescript/src/games/falling-sticks/components/GameBackground.d.ts +0 -6
- package/lib/typescript/src/games/falling-sticks/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/find-different-number/FindDifferentNumberService.d.ts +0 -6
- package/lib/typescript/src/games/find-different-number/FindDifferentNumberStore.d.ts +0 -36
- package/lib/typescript/src/games/find-different-number/components/GameGrid.d.ts +0 -7
- package/lib/typescript/src/games/find-different-number/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/flappy-bird/FlappyBirdStore.d.ts +0 -68
- package/lib/typescript/src/games/flappy-bird/components/Bird.d.ts +0 -2
- package/lib/typescript/src/games/flappy-bird/components/GameArea.d.ts +0 -7
- package/lib/typescript/src/games/flappy-bird/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/flappy-bird/components/Pipes.d.ts +0 -8
- package/lib/typescript/src/games/flappy-bird/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/fruit-merger/FruitMergerService.d.ts +0 -3
- package/lib/typescript/src/games/fruit-merger/FruitMergerStore.d.ts +0 -66
- package/lib/typescript/src/games/fruit-merger/components/FruitItem.d.ts +0 -8
- package/lib/typescript/src/games/fruit-merger/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/fruit-merger/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts +0 -73
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts +0 -38
- package/lib/typescript/src/games/fruit-ninja/components/FruitComponent.d.ts +0 -8
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +0 -7
- package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/game-2048/Game2048Service.d.ts +0 -102
- package/lib/typescript/src/games/game-2048/Game2048Store.d.ts +0 -44
- package/lib/typescript/src/games/game-2048/components/GameGrid.d.ts +0 -2
- package/lib/typescript/src/games/game-2048/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/knife-hit/KnifeHitService.d.ts +0 -48
- package/lib/typescript/src/games/knife-hit/KnifeHitStore.d.ts +0 -41
- package/lib/typescript/src/games/knife-hit/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/knife-hit/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/ludo-king/LudoKingService.d.ts +0 -33
- package/lib/typescript/src/games/ludo-king/LudoKingStore.d.ts +0 -34
- package/lib/typescript/src/games/ludo-king/components/Dice.d.ts +0 -7
- package/lib/typescript/src/games/ludo-king/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/ludo-king/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/maze-runner/MazeRunnerStore.d.ts +0 -62
- package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts +0 -10
- package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts +0 -33
- package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts +0 -24
- package/lib/typescript/src/games/maze-runner/components/SkiaPipeComponent.d.ts +0 -24
- package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts +0 -9
- package/lib/typescript/src/games/memory-match/MemoryMatchService.d.ts +0 -6
- package/lib/typescript/src/games/memory-match/MemoryMatchStore.d.ts +0 -42
- package/lib/typescript/src/games/memory-match/components/Card.d.ts +0 -6
- package/lib/typescript/src/games/memory-match/components/GameBoard.d.ts +0 -6
- package/lib/typescript/src/games/memory-match/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/mine-sweeper/MineSweeperService.d.ts +0 -22
- package/lib/typescript/src/games/mine-sweeper/MineSweeperStore.d.ts +0 -73
- package/lib/typescript/src/games/mine-sweeper/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/mine-sweeper/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/mob-control/MobControlService.d.ts +0 -74
- package/lib/typescript/src/games/mob-control/MobControlStore.d.ts +0 -66
- package/lib/typescript/src/games/mob-control/components/GameArea.d.ts +0 -11
- package/lib/typescript/src/games/mob-control/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/number-search/NumberSearchConstants.d.ts +0 -63
- package/lib/typescript/src/games/number-search/NumberSearchService.d.ts +0 -34
- package/lib/typescript/src/games/number-search/NumberSearchStore.d.ts +0 -70
- package/lib/typescript/src/games/number-search/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/number-search/components/NumberList.d.ts +0 -2
- package/lib/typescript/src/games/number-search/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBoltsService.d.ts +0 -67
- package/lib/typescript/src/games/nuts-and-bolts/NutsAndBoltsStore.d.ts +0 -45
- package/lib/typescript/src/games/nuts-and-bolts/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/nuts-and-bolts/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/pac-man/PacManService.d.ts +0 -73
- package/lib/typescript/src/games/pac-man/PacManStore.d.ts +0 -89
- package/lib/typescript/src/games/pac-man/components/GameCanvas.d.ts +0 -2
- package/lib/typescript/src/games/pac-man/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/paper-io/PaperIoService.d.ts +0 -70
- package/lib/typescript/src/games/paper-io/PaperIoStore.d.ts +0 -51
- package/lib/typescript/src/games/paper-io/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/paper-io/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts +0 -15
- package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts +0 -55
- package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts +0 -8
- package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/pipe-connect/PipeConnectService.d.ts +0 -17
- package/lib/typescript/src/games/pipe-connect/PipeConnectStore.d.ts +0 -31
- package/lib/typescript/src/games/pipe-connect/components/GameArea.d.ts +0 -7
- package/lib/typescript/src/games/pipe-connect/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +0 -30
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +0 -33
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts +0 -10
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts +0 -10
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/reversi/ReversiStore.d.ts +0 -46
- package/lib/typescript/src/games/reversi/components/GameBoard.d.ts +0 -6
- package/lib/typescript/src/games/reversi/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersService.d.ts +0 -6
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersStore.d.ts +0 -38
- package/lib/typescript/src/games/sliding-numbers/components/NumbersGrid.d.ts +0 -7
- package/lib/typescript/src/games/sliding-numbers/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/snake-3d/Snake3DService.d.ts +0 -29
- package/lib/typescript/src/games/snake-3d/Snake3DStore.d.ts +0 -49
- package/lib/typescript/src/games/snake-3d/components/GameGrid.d.ts +0 -2
- package/lib/typescript/src/games/snake-3d/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/snakes-and-ladders/SnakesAndLaddersService.d.ts +0 -22
- package/lib/typescript/src/games/snakes-and-ladders/SnakesAndLaddersStore.d.ts +0 -40
- package/lib/typescript/src/games/snakes-and-ladders/components/Dice.d.ts +0 -7
- package/lib/typescript/src/games/snakes-and-ladders/components/GameBoard.d.ts +0 -2
- package/lib/typescript/src/games/snakes-and-ladders/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts +0 -117
- package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts +0 -54
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +0 -9
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +0 -9
- package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts +0 -6
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts +0 -11
- package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts +0 -9
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaireService.d.ts +0 -23
- package/lib/typescript/src/games/spider-solitaire/SpiderSolitaireStore.d.ts +0 -71
- package/lib/typescript/src/games/spider-solitaire/components/Card.d.ts +0 -10
- package/lib/typescript/src/games/spider-solitaire/components/CardPile.d.ts +0 -12
- package/lib/typescript/src/games/spider-solitaire/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/stack-tower/StackTowerService.d.ts +0 -51
- package/lib/typescript/src/games/stack-tower/StackTowerStore.d.ts +0 -52
- package/lib/typescript/src/games/stack-tower/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/stack-tower/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/sudoku/SudokuService.d.ts +0 -24
- package/lib/typescript/src/games/sudoku/SudokuStore.d.ts +0 -65
- package/lib/typescript/src/games/sudoku/components/GameArea.d.ts +0 -8
- package/lib/typescript/src/games/sudoku/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/tangram/TangramService.d.ts +0 -6
- package/lib/typescript/src/games/tangram/TangramStore.d.ts +0 -34
- package/lib/typescript/src/games/tangram/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/tangram/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/tank-1990/Tank1990Service.d.ts +0 -80
- package/lib/typescript/src/games/tank-1990/Tank1990Store.d.ts +0 -48
- package/lib/typescript/src/games/tank-1990/components/Controls.d.ts +0 -2
- package/lib/typescript/src/games/tank-1990/components/GameBoard.d.ts +0 -2
- package/lib/typescript/src/games/tank-1990/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/tic-tac-toe/TicTacToeService.d.ts +0 -0
- package/lib/typescript/src/games/tic-tac-toe/TicTacToeStore.d.ts +0 -51
- package/lib/typescript/src/games/tic-tac-toe/components/GameBoard.d.ts +0 -6
- package/lib/typescript/src/games/tic-tac-toe/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/tile-home/TileHomeService.d.ts +0 -1
- package/lib/typescript/src/games/tile-home/TileHomeStore.d.ts +0 -57
- package/lib/typescript/src/games/tile-home/components/AnimatingTile.d.ts +0 -9
- package/lib/typescript/src/games/tile-home/components/FlyingTile.d.ts +0 -16
- package/lib/typescript/src/games/tile-home/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/tile-home/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/tile-home/components/TileItem.d.ts +0 -11
- package/lib/typescript/src/games/tile-home/components/TileSlot.d.ts +0 -7
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts +0 -32
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts +0 -39
- package/lib/typescript/src/games/whack-a-mole/components/GameBackground.d.ts +0 -7
- package/lib/typescript/src/games/whack-a-mole/components/GameGrid.d.ts +0 -10
- package/lib/typescript/src/games/whack-a-mole/components/GameHole.d.ts +0 -11
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts +0 -6
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/word-search/WordSearchConstants.d.ts +0 -63
- package/lib/typescript/src/games/word-search/WordSearchService.d.ts +0 -34
- package/lib/typescript/src/games/word-search/WordSearchStore.d.ts +0 -70
- package/lib/typescript/src/games/word-search/components/GameBoard.d.ts +0 -7
- package/lib/typescript/src/games/word-search/components/ScoreBoard.d.ts +0 -6
- package/lib/typescript/src/games/word-search/components/WordList.d.ts +0 -2
- package/lib/typescript/src/helpers/AnimatedScore.d.ts +0 -36
- package/lib/typescript/src/helpers/AnimationFrame.d.ts +0 -40
- package/lib/typescript/src/helpers/AnimationTracker.d.ts +0 -44
- package/lib/typescript/src/helpers/BlastAnimation.d.ts +0 -16
- package/lib/typescript/src/helpers/ErrorHandler.d.ts +0 -123
- package/lib/typescript/src/helpers/GameBackgroundPattern.d.ts +0 -7
- package/lib/typescript/src/helpers/GameControlButton.d.ts +0 -11
- package/lib/typescript/src/helpers/GameOverModal.d.ts +0 -15
- package/lib/typescript/src/helpers/GameTimer.d.ts +0 -26
- package/lib/typescript/src/helpers/Icons.d.ts +0 -12
- package/lib/typescript/src/helpers/ParticleBlast.d.ts +0 -11
- package/lib/typescript/src/helpers/ScoreBoardContainer.d.ts +0 -85
- package/lib/typescript/src/helpers/assets/apple-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/avocado-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/banana-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/bomb-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/broccoli-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/cherries-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/donut-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/dragonfruit-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/fries-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/fruit-helpers.d.ts +0 -154
- package/lib/typescript/src/helpers/assets/grapes-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/icecream-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/index.d.ts +0 -31
- package/lib/typescript/src/helpers/assets/kiwi-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/mango-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/orange-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/papaya-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/papaya-full-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/peach-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/pineapple-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/pomegranate-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/pumpkin-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/raspberry-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/star-item.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/strawberry-fruit.d.ts +0 -4
- package/lib/typescript/src/helpers/assets/watermelon-fruit.d.ts +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{gamePattern,PATTERN_GRID_COLOR}from"../../helpers/GamePatternData.js";import{getScreenDimensions}from"../../services/UtilsService.js";import{cacheGameAsset,createGameMesh as _0x2add86}from"./EngineMeshes.js";import{frontLight,toColor}from"./EngineUtils.js";export const BACKDROP_LIGHT=frontLight([0,0,1],1);const GRID_STEP=16,SEGMENTS=40,CORNER_SEGMENTS=6,LAYER_GAP=.05;function gradientAt(t,e,r,n){const s=t.end[0]-t.start[0],o=t.end[1]-t.start[1],i=Math.max(0,Math.min(1,((r-t.start[0])*s+(n-t.start[1])*o)/(s*s+o*o)))*(e.length-1),h=Math.min(e.length-2,Math.floor(i)),a=i-h,l=e[h],d=e[h+1];return[l[0]+(d[0]-l[0])*a,l[1]+(d[1]-l[1])*a,l[2]+(d[2]-l[2])*a,l[3]+(d[3]-l[3])*a]}function contains(t,e,r){switch(t.kind){case"circle":return(e-t.cx)**2+(r-t.cy)**2<=t.r*t.r;case"rrect":return e>=t.x&&e<=t.x+t.w&&r>=t.y&&r<=t.y+t.h;default:return Math.abs(e-t.cx)+Math.abs(r-t.cy)<=t.size/2}}class Compositor{gridColor=toColor(PATTERN_GRID_COLOR);constructor(t,e,r){this.pattern=t,this.opacity=r,this.stops=t.gradients.map(t=>t.colors.map(t=>toColor(t))),this.colors=t.shapes.map(t=>toColor(t.color)),this.bg=toColor(e)}at(t,e,r,n){let s=0,o=0,i=0,h=0;const a=t=>{const e=1-t[3];s=t[0]*t[3]+s*e,o=t[1]*t[3]+o*e,i=t[2]*t[3]+i*e,h=t[3]+h*e};this.pattern.gradients.forEach((r,n)=>a(gradientAt(r,this.stops[n],t,e)));for(let n=0;n<r;n++)contains(this.pattern.shapes[n],t,e)&&a(this.colors[n]);"number"==typeof n?a(this.colors[n]):"grid"===n&&a(this.gridColor);const l=this.opacity;return[s*l+this.bg[0]*(1-h*l),o*l+this.bg[1]*(1-h*l),i*l+this.bg[2]*(1-h*l)]}}class MeshBuilder{vertices=[];indices=[];vertex(t,e,r,[n,s,o]){return this.vertices.push(t,-e,r,0,0,1,n,s,o,0,0),this.vertices.length/11-1}quad(t,e,r,n){this.indices.push(t,e,r,t,r,n)}geometry(){return{vertices:new Float32Array(this.vertices),indices:new Uint32Array(this.indices)}}}function outline(t){if("circle"===t.kind)return Array.from({length:40},(e,r)=>{const n=-r/40*Math.PI*2;return[t.cx+Math.cos(n)*t.r,t.cy+Math.sin(n)*t.r]});if("diamond"===t.kind){const e=t.size/2;return[[t.cx+e,t.cy],[t.cx,t.cy-e],[t.cx-e,t.cy],[t.cx,t.cy+e]]}const e=Math.min(t.r,t.w/2,t.h/2),r=[[t.x+t.w-e,t.y+t.h-e,-Math.PI/2],[t.x+t.w-e,t.y+e,0],[t.x+e,t.y+e,Math.PI/2],[t.x+e,t.y+t.h-e,Math.PI]],n=[];for(const[t,s,o]of r)for(let r=0;r<=6;r++){const i=o+r/6*(Math.PI/2);n.push([t+Math.cos(i)*e,s-Math.sin(i)*e])}return n}function centreOf(t){return"rrect"===t.kind?[t.x+t.w/2,t.y+t.h/2]:[t.cx,t.cy]}function buildGeometry(t,e,r,n=!0){const s=new MeshBuilder,o=new Compositor(t,e,r),{width:i,height:h,shapes:a}=t,l=n?t.grid:[],d=Math.ceil(i/16),u=Math.ceil(h/16),m=s.vertices.length/11;for(let t=0;t<=u;t++){const e=Math.min(h,16*t);for(let t=0;t<=d;t++){const r=Math.min(i,16*t);s.vertex(r,e,0,o.at(r,e,0,null))}}const f=(t,e)=>m+e*(d+1)+t;for(let t=0;t<u;t++)for(let e=0;e<d;e++)s.quad(f(e,t+1),f(e+1,t+1),f(e+1,t),f(e,t));a.forEach((t,e)=>{const r=.05*(e+1),[n,i]=centreOf(t),h=s.vertex(n,i,r,o.at(n,i,e,e)),a=outline(t).map(([t,n])=>s.vertex(t,n,r,o.at(t,n,e,e)));a.forEach((t,e)=>s.indices.push(h,t,a[(e+1)%a.length]))});const g=.05*(a.length+1);for(const t of l){const e=Math.max(t.w,t.h),r=Math.max(1,Math.ceil(e/16)),n=t.h>t.w;let i=null;for(let h=0;h<=r;h++){const r=Math.min(e,16*h),l=n?[t.x,t.y+r,t.x+t.w,t.y+r]:[t.x+r,t.y,t.x+r,t.y+t.h],d=s.vertex(l[0],l[1],g,o.at(l[0],l[1],a.length,"grid")),u=s.vertex(l[2],l[3],g,o.at(l[2],l[3],a.length,"grid"));i&&(n?s.quad(d,u,i[1],i[0]):s.quad(i[1],u,d,i[0])),i=[d,u]}}return s.geometry()}const meshes=new Map;export function backdropMesh(t){const{width:e,height:r}=getScreenDimensions(),n=t.BACKGROUND+":"+t.PATTERN_OPACITY+":"+Math.round(e)+"x"+Math.round(r);let s=meshes.get(n);return!s&&(s=cacheGameAsset("backdrop:"+n,()=>_0x2add86(buildGeometry(gamePattern(e,r),t.BACKGROUND,t.PATTERN_OPACITY),{center:!1})),meshes.set(n,s)),s}const FLOATS=11;function clipGeometry({vertices:t,indices:e},r){const n=[],s=[],o=e=>Array.from(t.subarray(11*e,11*e+11));for(let t=0;t<e.length;t+=3){let i=[o(e[t]),o(e[t+1]),o(e[t+2])];for(let t=0;t<r.length&&i.length>0;t++){const[e,n]=r[t],[s,o]=r[(t+1)%r.length],h=t=>(s-e)*(t[1]-n)-(o-n)*(t[0]-e),a=[];for(let t=0;t<i.length;t++){const e=i[t],r=i[(t+1)%i.length],n=h(e),s=h(r);if(n>=0&&a.push(e),n>=0!=s>=0){const t=n/(n-s);a.push(e.map((e,n)=>e+(r[n]-e)*t))}}i=a}if(i.length<3)continue;const h=n.length/11;for(const t of i)n.push(...t);for(let t=1;t+1<i.length;t++)s.push(h,h+t,h+t+1)}return{vertices:new Float32Array(n),indices:new Uint32Array(s)}}export function cardBackdropMesh(t,e,r,n){const s=getScreenDimensions(),[o,i]=[Math.round(e),Math.round(r)],h="card-nogrid:"+t.BACKGROUND+":"+t.PATTERN_OPACITY+":"+Math.round(s.width)+"x"+Math.round(s.height)+":"+o+"x"+i+":"+n;let a=meshes.get(h);if(!a){const e=Math.min(n,o/2,i/2),r=[],l=[[o-e,-i+e,-Math.PI/2],[o-e,-e,0],[e,-e,Math.PI/2],[e,-i+e,Math.PI]];for(const[t,n,s]of l)for(let o=0;o<=6;o++){const i=s+o/6*(Math.PI/2);r.push([t+Math.cos(i)*e,n+Math.sin(i)*e])}const d=buildGeometry(gamePattern(s.width,s.height),t.BACKGROUND,t.PATTERN_OPACITY,!1);a=_0x2add86(clipGeometry(d,r),{center:!1}),meshes.set(h,a)}return a}export function spawnBackdrop(t,e,r,n,s){return t.spawn({mesh:backdropMesh(s),position:[-e/2,r/2,n],color:[1,1,1,1],pickable:!1})}export function setBackdropTheme(t,e,r){t.set(e,{mesh:backdropMesh(r)})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{effects,extrude,Path}from"@nayan-ui/engine";import{cacheGameAsset,createGameMesh as _0x3eb8ce}from"./EngineMeshes.js";const WHITE=[1,1,1,1],fade=e=>[e[0],e[1],e[2],0];let disc=null;const discMesh=()=>cacheGameAsset("shared/EngineBlasts:discMesh",()=>disc??=_0x3eb8ce(extrude((new Path).addCircle(0,0,.5),{depth:0})));export function popBurst(e,s){const[t,i,o]=s.color;effects.sparkle(e,{position:s.position,count:s.count??8,size:.2*s.size,speed:6*s.size,lifetime:.45,colors:[s.color,WHITE],flash:!1});const n=e.spawn({mesh:discMesh(),position:[s.position[0],s.position[1],s.glowZ??s.position[2]],scale:.85*s.size,color:[t,i,o,.6],pickable:!1});e.animate(n,{scale:2.8*s.size,color:[t,i,o,0]},{duration:.28}).then(()=>{e.has(n)&&e.despawn(n)})}export function popAndBurst(e,s,t,i){const o=t.delay??0,n=t.duration??effects.POP_TIME;return o>0?e.after(o+.12*n,()=>popBurst(e,i)):popBurst(e,i),effects.pop(e,s,t)}let stickChip=null,catchRing=null;const stickChipMesh=()=>cacheGameAsset("shared/EngineBlasts:stickChipMesh",()=>stickChip??=_0x3eb8ce(extrude((new Path).addRoundedRect(-.5,-.09,1,.18,.07),{depth:.16}),{shine:.25})),catchRingMesh=()=>cacheGameAsset("shared/EngineBlasts:catchRingMesh",()=>catchRing??=_0x3eb8ce(extrude((new Path).addCircle(0,0,.5).addCircle(0,0,.465),{depth:0,fillRule:"evenodd"})));export function stickBlast(e,s,t){const[i,o]=t.scale,[n,a,r,l]=t.rotation,h=[1-2*(a*a+r*r),2*(n*a+l*r),2*(n*r-l*a)],p=[2*(n*r+l*a),2*(a*r-l*n),1-2*(n*n+a*a)],d=(e,s=0)=>[t.position[0]+h[0]*i*e+p[0]*s,t.position[1]+h[1]*i*e+p[1]*s,t.position[2]+h[2]*i*e+p[2]*s],f=popAndBurst(e,s,{scale:t.scale,color:t.color,duration:.32},{position:d(0,.6*o),size:Math.max(1.6*o,.24*i),color:t.color,count:14});stickChip=stickChipMesh(),effects.shatter(e,{position:d(0,.4*o),mesh:stickChip,count:7,size:.16*i,speed:2*i,lifetime:.5,gravity:4*-i,colors:[t.color,effects.pale(t.color,.4,1)],flash:!1,dust:!1});for(const s of[-1,1])effects.sparks(e,{position:d(.32*s,.5*o),count:4,size:.18*o,speed:2.5*i,lifetime:.35,gravity:1.5*-i,direction:[h[0]*s,h[1]*s,h[2]*s],spread:.9,colors:[t.color,WHITE],flash:!1});catchRing=catchRingMesh();const u=effects.pale(t.color,.45,.9),m=e.spawn({mesh:catchRing,position:d(0,.8*o),rotation:t.rotation,scale:1.8*o,color:u,pickable:!1});return e.animate(m,{scale:1.1*i,color:fade(u)},{duration:.32,easing:"easeOut"}).then(()=>{e.has(m)&&e.despawn(m)}),f}export function*warmAssets(){yield discMesh,yield stickChipMesh,yield catchRingMesh}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{extrude,loft,Path}from"@nayan-ui/engine";import{cacheGameAsset,createGameMesh as _0x1f3dd3}from"./EngineMeshes.js";const ASPECT_STEP=.25,blocks=new Map;function blockMesh(e,o){return cacheGameAsset("shared/EngineBlocks:blockMesh"+JSON.stringify([e,o]),()=>blockMeshUncached(e,o))}function blockMeshUncached(e,o){const s=e+":"+o;let t=blocks.get(s);if(!t){const a=e/2;t=_0x1f3dd3(loft([{z:-.5,bottom:-.5,top:.5,width:a,square:7},{z:.2,bottom:-.5,top:.5,width:a,square:7},{z:.4,bottom:-.465,top:.465,width:a-.035,square:6.5},{z:.5,bottom:-.39,top:.39,width:a-.11,square:5.5}],{around:40,smoothness:2}),{center:!1,shine:o?.6:0}),blocks.set(s,t)}return t}let shadow=null;const shadowMesh=()=>shadow??=_0x1f3dd3(extrude((new Path).addRoundedRect(-.5,-.5,1,1,.16),{depth:0})),SHADOW_AT=[.08,-.11,-.52],SHADOW_SIZE=1.04,SHADOW=[0,0,0,.3],aspectOf=e=>Math.max(.25,.25*Math.round(e[0]/e[1]/.25));export const raisedBlockScale=e=>[e[0]/aspectOf(e),e[1],e[2]];export function spawnRaisedBlock(e,{position:o,size:s,color:t,parent:a,grow:n=1,gloss:r=!0,shadow:h=!0}){const d=aspectOf(s),i=raisedBlockScale(s),l=e.spawn({mesh:blockMesh(d,r),parent:a,position:o,scale:[i[0]*n,i[1]*n,i[2]*n],color:t,pickable:!1});return h&&e.spawn({mesh:shadowMesh(),parent:l,position:SHADOW_AT,scale:[1.04*d,1.04,1],color:SHADOW,pickable:!1}),l}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export function fitControlSubtitle(t,r,i){const e=t.trim().split(/\s+/).filter(Boolean),n=e.slice(0,4).join(" ")+(e.length>4?"\u2026":"");if(!n||r<=0)return"";if(i(n)<=r)return n;if(i("\u2026")>r)return"";const o=Array.from(n.replace(/\u2026$/,""));let l=0,s=o.length;for(;l<s;){const t=Math.ceil((l+s)/2);i(o.slice(0,t).join("").trimEnd()+"\u2026")<=r?l=t:s=t-1}return o.slice(0,l).join("").trimEnd()+"\u2026"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{effects,loft,merge,quat,shapeGeometry}from"@nayan-ui/engine";import{cacheGameAsset,createGameMesh as _0x138977}from"./EngineMeshes.js";const IVORY=[.98,.965,.925],IVORY_EDGE=[.86,.83,.77],PIP=[.11,.11,.16,1],RED_PIP=[.84,.16,.16,1],FACES=[{n:[0,0,1],a:[1,0,0],b:[0,1,0]},{n:[0,1,0],a:[1,0,0],b:[0,0,1]},{n:[1,0,0],a:[0,1,0],b:[0,0,1]},{n:[-1,0,0],a:[0,1,0],b:[0,0,1]},{n:[0,-1,0],a:[1,0,0],b:[0,0,1]},{n:[0,0,-1],a:[1,0,0],b:[0,1,0]}],C=.24,PIPS=[[[0,0]],[[-C,C],[C,-C]],[[-C,C],[0,0],[C,-C]],[[-C,C],[C,C],[-C,-C],[C,-C]],[[-C,C],[C,C],[0,0],[-C,-C],[C,-C]],[[-C,C],[C,C],[-C,0],[C,0],[-C,-C],[C,-C]]],EDGE=.12;let die=null;export function dieMesh(){return cacheGameAsset("shared/EngineDice:dieMesh",()=>dieMeshUncached())}function dieMeshUncached(){if(die)return die;const t=[0,.25,.5,.7,.85,.95,1].map(t=>.38+.12*t),a=[...t.map(t=>-t).reverse(),...t].map(t=>{const a=Math.max(.02,(t=>{const a=Math.abs(t)-.38;return a<=0?.5:.38+Math.sqrt(Math.max(0,.0144-a*a))})(t));return{z:t,bottom:-a,top:a,width:a,square:9}}),e=[{geometry:loft(a,{around:48,smoothness:1,color:(t,a)=>{const e=Math.max(Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2]))**6;return[IVORY_EDGE[0]+(IVORY[0]-IVORY_EDGE[0])*e,IVORY_EDGE[1]+(IVORY[1]-IVORY_EDGE[1])*e,IVORY_EDGE[2]+(IVORY[2]-IVORY_EDGE[2])*e,1]}})}],o=shapeGeometry("sphere");return FACES.forEach(({n:t,a:a,b:n},s)=>{const i=0===s,h=i?.28:.17;for(const[r,d]of PIPS[s])e.push({geometry:o,position:[0,1,2].map(e=>.488*t[e]+a[e]*r+n[e]*d),scale:[0,1,2].map(a=>t[a]?.035:h),color:i?RED_PIP:PIP})}),die=_0x138977(merge(e),{shine:.45}),die}const axisAngle=(t,a,e,o)=>{const n=Math.hypot(t,a,e)||1;return quat.axisAngle(t/n,a/n,e/n,o)},mul=quat.multiply,FACE_UP=[axisAngle(1,0,0,0),axisAngle(1,0,0,Math.PI/2),axisAngle(0,1,0,-Math.PI/2),axisAngle(0,1,0,Math.PI/2),axisAngle(1,0,0,-Math.PI/2),axisAngle(0,1,0,Math.PI)];export const dieRotation=(t,a,e=0)=>mul(axisAngle(1,0,0,t),mul(axisAngle(0,0,1,e),FACE_UP[a-1]));const HOPS=[{up:.2,down:.44,height:1.7},{up:.555,down:.67,height:.55},{up:.735,down:.8,height:.16}];export function rollDie(t,a){const{die:e,shadow:o,rest:n,size:s,duration:i}=a;t.stopAnimation(e),t.stopAnimation(o);const h=Math.random()*Math.PI*2,r=t=>[Math.cos(h)*s*t,Math.sin(h)*s*t*.6],d=[.35,-.2,.06],l=[],u=[],m=(t,e,o)=>{const[n,s]=r(t),i=1-Math.min(.55,.3*e);var h,d;u.push({position:(h=n,d=s,[a.shadowAt[0]+h,a.shadowAt[1]+d,a.shadowAt[2]]),scale:[a.shadowScale[0]*i,a.shadowScale[1]*i,a.shadowScale[2]],color:[0,0,0,.22*i],at:o})};let p=0;HOPS.forEach((t,a)=>{const e=d[a],o=(p+e)/2,[i,h]=r(o);l.push({position:[n[0]+i,n[1]+h,n[2]+t.height*s],at:t.up}),m(o,t.height,t.up);const[u,C]=r(e);l.push({position:[n[0]+u,n[1]+C,n[2]],at:t.down}),m(e,0,t.down),p=e}),l.push({position:n,at:1}),u.push({position:a.shadowAt,scale:a.shadowScale,color:[0,0,0,.22],at:1}),t.animate(e,l,{duration:i,path:"smooth",easing:"linear"}),t.animate(o,u,{duration:i,easing:"linear"});const C=(Math.round(4*Math.random())-2)*(Math.PI/2)+.3*(Math.random()-.5),M=dieRotation(a.tilt,a.value,C),g=[2.4,2.1,1.6,.9],E=[];let P=M;for(let t=g.length-1;t>=0;t--){const a=[Math.random()-.5,Math.random()-.5,Math.random()-.5];P=mul(axisAngle(a[0],a[1],a[2],-g[t]),P),E.unshift({rotation:P,at:[.12,.3,.5,.64][t]})}E.push({rotation:M,at:HOPS[1].down}),E.push({rotation:M,at:1}),t.animate(e,E,{duration:i,easing:"linear"}),HOPS.slice(0,2).forEach((e,o)=>t.after(e.down*i,()=>{if(a.disposed?.())return;const[e,i]=r(d[o]);effects.dust(t,{position:[n[0]+e,n[1]+i,n[2]-.45*s],count:o?3:6,size:s*(o?.35:.5),speed:2.5*s,lifetime:.4,color:[1,1,1,.45],endSize:1.8})}))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export function overlapAcross(t,a,h,n,e=9){const r=Math.max(-t.length/2,h-a.length/2),l=Math.min(t.length/2,h+a.length/2);if(l<=r)return-1/0;let o=-1/0;for(let s=0;s<e;s++){const i=r+(l-r)*s/(e-1);o=Math.max(o,t.halfWidth(-i)+a.halfWidth(-(i-h))-Math.abs(n))}return o}export function frontHit(t,a,h,n,e=.5){return(t.length+a.length)/2-Math.abs(h)<e+Math.max(0,Math.abs(h)-Math.abs(n))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{extrude,lathe,merge,Path,recolor,tube}from"@nayan-ui/engine";import{cacheGameAsset,createGameMesh as _0x5a3f3a}from"./EngineMeshes.js";function boxCenter(e){const t=[1/0,1/0,1/0],o=[-1/0,-1/0,-1/0];for(let s=0;s<e.vertices.length;s+=11)for(let r=0;r<3;r++)t[r]=Math.min(t[r],e.vertices[s+r]),o[r]=Math.max(o[r],e.vertices[s+r]);return[(t[0]+o[0])/2,(t[1]+o[1])/2,(t[2]+o[2])/2]}const TAU=2*Math.PI,fract=e=>e-Math.floor(e),hash=(e,t)=>fract(43758.5453*Math.sin(127.1*e+311.7*t)),smooth=e=>e*e*(3-2*e),clamp01=e=>Math.max(0,Math.min(1,e)),smoothstep=(e,t,o)=>smooth(clamp01((o-e)/(t-e)));function noise(e,t,o,s){const r=e*o,n=t*s,a=Math.floor(r),h=Math.floor(n),i=smooth(r-a),m=smooth(n-h),l=(e,t)=>hash((e%o+o)%o,t),u=l(a,h)+(l(a+1,h)-l(a,h))*i;return u+(l(a,h+1)+(l(a+1,h+1)-l(a,h+1))*i-u)*m}const mix=(e,t,o)=>[e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o,e[2]+(t[2]-e[2])*o],shade=(e,t)=>[e[0]*t,e[1]*t,e[2]*t],turn=(e,t)=>[e[0]*Math.sin(t/2),e[1]*Math.sin(t/2),e[2]*Math.sin(t/2),Math.cos(t/2)];function mul(e,t){const[o,s,r,n]=e,[a,h,i,m]=t;return[n*a+o*m+s*i-r*h,n*h-o*i+s*m+r*a,n*i+o*h-s*a+r*m,n*m-o*a-s*h-r*i]}function upTo(e){const t=[e[2],0,-e[0]],o=Math.hypot(t[0],t[2]);return o<1e-6?e[1]>0?[0,0,0,1]:[1,0,0,0]:turn([t[0]/o,0,t[2]/o],Math.acos(Math.max(-1,Math.min(1,e[1]))))}const yTurn=e=>turn([0,1,0],e);function warp(e,t){const o=e.vertices,s=1e-4,r=(e,t)=>[(e[0]-t[0])/s,(e[1]-t[1])/s,(e[2]-t[2])/s],n=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]];for(let e=0;e<o.length;e+=11){const[a,h,i]=[o[e],o[e+1],o[e+2]],m=t([a,h,i]),[l,u,p]=[r(t([a+s,h,i]),m),r(t([a,h+s,i]),m),r(t([a,h,i+s]),m)],[g,M,f]=[n(u,p),n(p,l),n(l,u)],[x,y,d]=[o[e+3],o[e+4],o[e+5]],w=[0,1,2].map(e=>x*g[e]+y*M[e]+d*f[e]),P=Math.hypot(w[0],w[1],w[2]);o.set(m,e),P>1e-12&&o.set([w[0]/P,w[1]/P,w[2]/P],e+3)}return e}let detail=1;const seg=e=>e<=8?e:Math.max(8,Math.round(e*detail));function profile(e,t,o=48){o=seg(o);const s=[];for(let r=0;r<=o;r++){const n=r/o;s.push([Math.max(0,t(n)),e/2-n*e])}return s}function resample(e,t){t=seg(t);const o=[0];for(let t=1;t<e.length;t++)o.push(o[t-1]+Math.hypot(e[t][0]-e[t-1][0],e[t][1]-e[t-1][1]));const s=o[o.length-1],r=[];let n=0;for(let a=0;a<=t;a++){const h=a/t*s;for(;n<e.length-2&&o[n+1]<h;)n++;const i=(h-o[n])/(o[n+1]-o[n]||1);r.push([e[n][0]+(e[n+1][0]-e[n][0])*i,e[n][1]+(e[n+1][1]-e[n][1])*i])}return r}const rounded=(e,t,o=2,s=64)=>profile(e,e=>t*Math.pow(Math.max(0,1-Math.pow(Math.abs(2*e-1),o)),1/o),s);function radiusAt(e,t){let o=0;for(let s=0;s<e.length-1;s++){const[r,n]=e[s],[a,h]=e[s+1];(t-n)*(t-h)<=0&&n!==h&&(o=Math.max(o,r+(t-n)/(h-n)*(a-r)))}return o}function undimpled(e){let[t,o]=[0,0];return e.forEach((s,r)=>{s[1]>e[t][1]&&(t=r),s[1]<e[o][1]&&(o=r)}),e.slice(t,o+1)}function normalize(e){const t=Math.max(...e.map(e=>e[1])),o=Math.min(...e.map(e=>e[1])),s=2*Math.max(...e.map(e=>e[0])),r=1/Math.max(s,t-o),n=(t+o)/2;return e.map(([e,t])=>[e*r,(t-n)*r])}function onSurface(e,t,o){const s=t*(e.length-1),r=Math.min(e.length-2,Math.floor(s)),n=s-r,[a,h]=e[r],[i,m]=e[r+1],l=a+(i-a)*n,u=h+(m-h)*n,p=Math.hypot(i-a,m-h)||1,[g,M]=[(h-m)/p,(i-a)/p],[f,x]=[Math.cos(o),-Math.sin(o)];return[[l*f,u,l*x],[g*f,M,g*x]]}const LEAF_TOP=[.24,.56,.17],LEAF_UNDER=[.19,.46,.14],VEIN=[.55,.74,.36];function leaf(e,t,{fold:o=.38,teeth:s=14,stalk:r=.16}={}){const n=o=>{const r=[[0,0]],n=2*s;for(let s=1;s<n;s++){const a=s/n,h=s%2?.07:0,i=t*Math.pow(Math.sin(Math.PI*a),.75)*(1-.25*a)*(1+h);r.push([e*a,o*i])}return r.push([e,0]),extrude((new Path).addPolygon(r.map(([e,t])=>[e,-t])),{depth:.006})};return merge([{geometry:n(1),rotation:turn([1,0,0],o),color:LEAF_TOP},{geometry:n(-1),rotation:turn([1,0,0],-o),color:LEAF_UNDER},{geometry:tube([[0,0,0],[.5*e,.004,0],[.96*e,0,0]],{radius:e=>.007*(1-e)+.002,sides:seg(6)}),color:VEIN},{geometry:tube([[-e*r,-.01,0],[0,0,0]],{radius:.008,sides:seg(6)}),color:[.36,.42,.18]}])}function stem(e,t=.024,o=.06){return tube([[0,-.03,0],[.005,.4*e,0],[.5*o,.8*e,0],[o,e,0]],{radius:e=>t*(1.25-.45*e+(e>.9?.5*(e-.9)*10:0)),sides:seg(8),color:e=>mix([.33,.21,.1],[.5,.42,.28],smoothstep(.75,1,e.v)+.15*noise(e.u,e.v,6,10)),capColor:[.62,.55,.4]})}const seed=(e=8)=>lathe([[0,.5],[.22,.32],[.4,.02],[.36,-.28],[.2,-.45],[0,-.5]],{segments:e}),calyx=(e,t,o,s=.012)=>extrude((new Path).addStar(0,0,e,t,o),{depth:s}),FACE_UP=turn([1,0,0],-Math.PI/2),CUT_ACROSS=turn([1,0,0],-Math.PI/2),SKIN_SEGMENTS=72,halfTurn=e=>t=>e({u:.5*t.u,v:t.v}),upperHalf=e=>t=>e({u:t.u,v:.5*t.v}),upperDisplace=e=>(t,o)=>e(t,.5*o);function apple(){const e=normalize(resample(Path.fromSVG("M0 0.1 C 0.12 -0.03 0.42 -0.06 0.5 0.3 C 0.55 0.62 0.36 0.9 0.14 0.93 Q 0.05 0.94 0 0.88").toContours()[0].map(([e,t])=>[e,-t]),64)),t=[.68,.04,.06],o=[.45,.02,.05],s=[.86,.66,.18],r=({u:e,v:r})=>{const n=noise(e,r,90,4);let a=mix(t,o,.7*smoothstep(.35,.9,n));return a=mix(a,s,.35*smoothstep(.55,.8,noise(e,r,7,3))),a=mix(a,[.72,.68,.22],.75*smoothstep(.16,.02,r)+.6*smoothstep(.86,.99,r)),hash(Math.floor(140*e),Math.floor(70*r))>.975&&(a=mix(a,[.95,.85,.55],.55)),a},n=e[0][1],a=e[e.length-1][1],h=lathe(e,{segments:seg(72),color:r}),i=merge([{geometry:h},{geometry:stem(.17,.022,.05),position:[0,n,0]},{geometry:leaf(.32,.075),position:[.03,n+.11,0],rotation:mul(turn([0,1,0],-.5),turn([0,0,1],.55))},{geometry:calyx(.05,.015,5),position:[0,a-.004,0],rotation:turn([1,0,0],Math.PI/2),color:[.3,.2,.1]}]),m=(e,t)=>{const o=Math.hypot(e/.2,t/.24);let s=[.97,.93,.74];return s=mix(s,[.92,.88,.62],smoothstep(1.05,.85,o)),s=mix(s,[.82,.76,.5],.6*smoothstep(.12,0,Math.abs(o-1))),mix(s,[1,.97,.88],.6*smoothstep(.88,1,e))};return withPieces({center:boxCenter(i),whole:_0x5a3f3a(i,{center:!1,shine:.65}),juice:[.98,.94,.75]},()=>{const t=merge([{geometry:lathe(undimpled(e),{segments:seg(72),sweep:Math.PI,color:halfTurn(r),cutColor:m,cutSteps:24,capColor:[.7,.62,.25]})},...[-1,1].map(e=>({geometry:seed(),position:[.06*e,-.02,.004],scale:[.045,.075,.02],rotation:turn([0,0,1],.35*e),color:[.3,.17,.08]}))]),o=_0x5a3f3a(t,{center:!1,shine:.3});return[o,o]})}function citrusFace(e,t,o,s,r){return(n,a)=>{if(n>1-.45*r)return e;if(n>1-r)return t;if(n<.12)return mix(t,o,smoothstep(.08,.12,n));const h=TAU/s,i=Math.abs(fract(a/h)-.5)*h*n,m=smoothstep(.5*h*n-.02,.5*h*n-.006,i),l=noise(a/TAU,n,6*s,9);return mix(shade(o,.92+.16*l),t,.85*m)}}const peel=(e,t)=>(o,s)=>-e*Math.pow(noise(o,s,t,.55*t),2)-.5*e*noise(o,s,2.5*t,1.4*t);function orange(){const e=normalize(rounded(.94,.5,2,64)),t=[1,.47,.03],o=({u:e,v:o})=>{let s=shade(t,.9+.14*noise(e,o,40,22));return s=mix(s,[.82,.55,.12],.6*smoothstep(.05,0,o)),mix(s,[.75,.35,.05],.7*smoothstep(.95,1,o))},s=peel(.006,64),r=e[0][1],n=merge([{geometry:lathe(e,{segments:seg(120),color:o,displace:s})},{geometry:calyx(.06,.025,5,.01),position:[0,r-.002,0],rotation:FACE_UP,color:[.3,.42,.14]},{geometry:tube([[0,r-.01,0],[0,r+.035,0]],{radius:.014,sides:seg(6)}),color:[.42,.4,.2]}]);return withPieces({center:boxCenter(n),whole:_0x5a3f3a(n,{center:!1,shine:.35}),juice:[1,.6,.1]},()=>{const r=e.slice(0,Math.floor(e.length/2)+1),n=citrusFace(shade(t,.95),[.99,.95,.84],[1,.58,.08],10,.12),a=_0x5a3f3a(merge([{geometry:lathe(r,{segments:seg(120),color:upperHalf(o),displace:upperDisplace(s),capColor:n,capRings:24}),rotation:CUT_ACROSS}]),{center:!1,shine:.25});return[a,a]})}function lemon(){const e=normalize(profile(1,e=>.34*Math.pow(Math.sin(Math.PI*e),.75),64)),t=[1,.86,.12],o=({u:e,v:o})=>{const s=shade(t,.9+.14*noise(e,o,36,20));return mix(s,[.62,.72,.15],.6*(smoothstep(.06,0,o)+smoothstep(.94,1,o)))},s=peel(.005,56),r=turn([0,0,1],Math.PI/2),n=merge([{geometry:lathe(e,{segments:seg(96),color:o,displace:s}),rotation:r}]);return withPieces({center:boxCenter(n),whole:_0x5a3f3a(n,{center:!1,shine:.4}),juice:[1,.95,.55]},()=>{const r=e.slice(0,Math.floor(e.length/2)+1),n=citrusFace(t,[.99,.97,.86],[1,.93,.5],9,.1),a=_0x5a3f3a(merge([{geometry:lathe(r,{segments:seg(96),color:upperHalf(o),displace:upperDisplace(s),capColor:n,capRings:20}),rotation:CUT_ACROSS}]),{center:!1,shine:.3});return[a,a]})}function pear(){const e=normalize(profile(1,e=>Math.pow(Math.sin(Math.PI*e),.55)*(.18+.37*Math.pow(e,1.35))*(1-.15*Math.exp(30*-e)),64)),t=({u:e,v:t})=>{let o=mix([.62,.74,.2],[.84,.8,.28],noise(e,t,6,4));const s=Math.pow(Math.max(0,Math.cos((e-.2)*TAU)),2)*smoothstep(.3,.8,t);return o=mix(o,[.78,.28,.12],.55*s),o=mix(o,[.55,.42,.18],.6*smoothstep(.12,0,t)),hash(Math.floor(120*e),Math.floor(64*t))>.95&&(o=mix(o,[.5,.38,.18],.65)),o},o=e[0][1],s=e[e.length-1][1],r=merge([{geometry:lathe(e,{segments:seg(72),color:t})},{geometry:stem(.2,.02,.07),position:[0,o,0]},{geometry:calyx(.035,.012,5),position:[0,s-.003,0],rotation:turn([1,0,0],Math.PI/2),color:[.32,.22,.12]}]),n=(e,t)=>{const o=Math.hypot(e/.17,(t+.15)/.17);let s=[.98,.96,.82];return s=mix(s,[.92,.9,.7],smoothstep(1.1,.8,o)),mix(s,[.86,.82,.58],.6*smoothstep(.1,0,Math.abs(o-1)))};return withPieces({center:boxCenter(r),whole:_0x5a3f3a(r,{center:!1,shine:.45}),juice:[.98,.96,.8]},()=>{const o=merge([{geometry:lathe(e,{segments:seg(72),sweep:Math.PI,color:halfTurn(t),cutColor:n})},...[-1,1].map(e=>({geometry:seed(),position:[.05*e,-.16,.004],scale:[.035,.06,.018],rotation:turn([0,0,1],.3*e),color:[.25,.14,.07]}))]),s=_0x5a3f3a(o,{center:!1,shine:.25});return[s,s]})}function strawberry(){const e=normalize(profile(1,e=>.5*Math.pow(Math.sin(Math.PI*Math.min(1,1.02*e)),.45)*(1-.62*Math.pow(e,1.2)),64)),t=({v:e})=>{let t=[.82,.05,.1];return t=mix(t,[.95,.8,.62],.7*smoothstep(.1,.02,e)),mix(t,[.95,.25,.12],.5*smoothstep(.8,1,e))},o=t=>{const o=[];for(let s=0;s<80;s++){const r=.14+.8*s/80,n=fract(.381966*s)*TAU;if(n>t)continue;const[a,h]=onSurface(e,r,n);o.push({geometry:seed(6),position:[a[0]-.003*h[0],a[1]-.003*h[1],a[2]-.003*h[2]],rotation:upTo(h),scale:[.022,.018,.03],color:[.95,.8,.3]})}return o},s=e[0][1],r=[];for(let e=0;e<8;e++){const t=e/8*TAU+.2;r.push({geometry:leaf(.26+.05*Math.sin(2.3*e),.05,{fold:.2,teeth:4,stalk:0}),position:[0,s+.012,0],rotation:mul(turn([0,1,0],t),turn([0,0,1],.08-.1*Math.cos(1.7*e)))})}const n=[...r,{geometry:stem(.12,.018,.02),position:[0,s-.02,0],color:[.55,1.2,.5]}],a=merge([{geometry:lathe(e,{segments:seg(72),color:t})},...o(TAU),...n]),h=(e,t)=>{const o=mix([1,.85,.82],[.88,.12,.16],smoothstep(.35,.85,e));return mix(o,[.98,.75,.72],.4*smoothstep(.12,0,Math.abs(e-.32))*smoothstep(-.4,.2,t))};return withPieces({center:boxCenter(a),whole:_0x5a3f3a(a,{center:!1,shine:.55}),juice:[.95,.15,.2]},()=>{const s=_0x5a3f3a(merge([{geometry:lathe(e,{segments:seg(72),sweep:Math.PI,color:halfTurn(t),cutColor:h})},...o(Math.PI)]),{center:!1,shine:.4});return[s,s]})}function watermelon(){const e=normalize(rounded(1,.36,2.2,64)),t=[.07,.27,.08],o=[.42,.62,.26],s=({u:e,v:s})=>{const r=.9*(noise(e,s,16,10)-.5),n=Math.sin((16*e+r)*TAU);let a=mix(o,t,smoothstep(-.35,.1,n));a=shade(a,.9+.15*noise(e,s,50,30));const h=smoothstep(.16,.05,Math.hypot(2.2*(fract(e-.75+.5)-.5),s-.5));return mix(a,[.82,.76,.38],.85*h)},r=turn([0,0,1],Math.PI/2),n=merge([{geometry:lathe(e,{segments:seg(96),color:s}),rotation:r}]),a=e=>e>.965?t:e>.92?mix([.62,.8,.45],[.85,.93,.7],(.965-e)/.045):e>.86?mix([.97,.97,.85],[.98,.55,.5],smoothstep(.92,.86,e)):mix([.98,.3,.32],[.88,.1,.16],smoothstep(.85,.2,e));return withPieces({center:boxCenter(n),whole:_0x5a3f3a(n,{center:!1,shine:.35}),juice:[.95,.2,.25]},()=>{const t=e.slice(0,Math.floor(e.length/2)+1),o=t[t.length-1][0],r=[];for(let e=0;e<14;e++){const t=e/14*TAU+e%2*.12,s=o*(.5+e%3*.1);r.push({geometry:seed(),position:[Math.cos(t)*s,-.004,-Math.sin(t)*s],rotation:mul(turn([0,1,0],t+Math.PI/2),turn([1,0,0],Math.PI/2)),scale:[.03,.05,.012],color:[.08,.05,.04]})}const n=merge([{geometry:merge([{geometry:lathe(t,{segments:seg(96),color:upperHalf(s),capColor:a,capRings:24})},...r]),rotation:CUT_ACROSS}]),h=_0x5a3f3a(n,{center:!1,shine:.25});return[h,h]})}function banana(){const e=[];for(let t=0;t<=12;t++){const o=Math.PI*(.12+.76*t/12);e.push([.5*-Math.cos(o),.3*-Math.sin(o),0])}const t=e.map(e=>e[0]),o=e.map(e=>e[1]),[s,r]=[(Math.min(...t)+Math.max(...t))/2,(Math.min(...o)+Math.max(...o))/2],n=.92/(Math.max(...t)-Math.min(...t)),a=e.map(([e,t])=>[(e-s)*n,(t-r)*n+.06,0]),h=e=>1+.06*Math.cos(e*TAU*5),i=a[a.length-1],m=a[a.length-2],l=[i[0]-m[0],i[1]-m[1]],u=Math.hypot(l[0],l[1]),p=[i[0]+l[0]/u*.1,i[1]+l[1]/u*.1+.015,0],g=tube([i,p],{radius:e=>.026-.006*e,shape:e=>1+.12*Math.cos(e*TAU*4),sides:seg(12),color:[.45,.48,.2],capColor:[.3,.25,.12]}),M=(e,t,o)=>tube(e,{radius:e=>{return s=t+(o-t)*e,.014+.09*Math.pow(Math.sin(Math.PI*Math.min(1,.03+.97*s)),.55);var s},shape:h,sides:seg(30),smoothness:6,color:e=>(({u:e,v:t})=>{let o=[1,.84,.16];o=mix(o,[.82,.76,.18],.4*(.5+.5*Math.cos(e*TAU*5))),o=mix(o,[.62,.72,.2],.6*smoothstep(.82,1,t)),o=mix(o,[.18,.12,.06],smoothstep(.05,0,t));const s=noise(e,t,18,26);return s>.78&&(o=mix(o,[.45,.28,.08],.9*smoothstep(.78,.88,s))),o})({u:e.u,v:t+(o-t)*e.v}),capColor:e=>{return(t=e)>.9?[1,.84,.16]:t<.22?[.86,.8,.58]:[.99,.95,.78];var t}}),f=merge([{geometry:M(a,0,1)},{geometry:g}]);return withPieces({center:boxCenter(f),whole:_0x5a3f3a(f,{center:!1,shine:.3}),juice:[1,.95,.72]},()=>{const e=Math.floor(a.length/2),t=M(a.slice(0,e+1),0,e/(a.length-1)),o=merge([{geometry:M(a.slice(e),e/(a.length-1),1)},{geometry:g}]);return[_0x5a3f3a(merge([{geometry:t,rotation:turn([0,1,0],-Math.PI/2)}]),{center:!1,shine:.3}),_0x5a3f3a(merge([{geometry:o,rotation:turn([0,1,0],Math.PI/2)}]),{center:!1,shine:.3})]})}function cherries(){const e=normalize(resample(Path.fromSVG("M0 0.12 C 0.1 0.01 0.46 -0.04 0.5 0.42 C 0.53 0.76 0.3 0.98 0 0.96").toContours()[0].map(([e,t])=>[e,-t]),40)),t=({u:e,v:t})=>{let o=mix([.55,.02,.07],[.26,0,.04],.6*smoothstep(.3,.75,noise(e,t,5,3))+.35*smoothstep(.5,1,t));return o=mix(o,[.78,.12,.12],.4*smoothstep(.2,.05,t)),mix(o,[.2,.02,.03],.7*smoothstep(.92,1,t))},o=e[0][1],s=.42,r=[[-.2,-.2,.02],[.19,-.28,-.04]],n=[.06,.55,0],a=(e,t)=>tube([[e[0],e[1]+o*s-.02,e[2]],[e[0]+.4*t,e[1]+.38,.5*e[2]],[n[0]+.15*t,n[1]-.12,0],n],{radius:e=>.012+.003*e,sides:seg(7),color:e=>mix([.4,.55,.16],[.42,.32,.14],smoothstep(.75,1,e.v)),capColor:[.35,.25,.12]}),h=[{geometry:a(r[0],-.1)},{geometry:a(r[1],.08)},{geometry:leaf(.3,.07),position:n,rotation:mul(turn([0,1,0],.6),turn([0,0,1],.4))}],i=lathe(e,{segments:seg(40),color:t}),m=merge([...r.map(e=>({geometry:i,position:e,scale:s})),...h]),l=(e,t)=>{const o=Math.hypot(e/.42,(t+.02)/.32);return o<1?mix([.93,.84,.66],[.8,.66,.5],o*o):mix([.62,.04,.1],[.42,.01,.06],smoothstep(1,2.2,o))};return withPieces({center:boxCenter(m),whole:_0x5a3f3a(m,{center:!1,shine:.85}),juice:[.6,.03,.1]},()=>{const o=lathe(undimpled(e),{segments:seg(40),sweep:Math.PI,color:halfTurn(t),cutColor:l,cutSteps:20,capColor:[.5,.04,.08]});return[_0x5a3f3a(merge([{geometry:o,position:[0,r[0][1],0],scale:s}]),{center:!1,shine:.7}),_0x5a3f3a(merge([{geometry:o,position:[0,r[1][1],0],scale:s},{geometry:merge(h),position:[-r[1][0],0,0],rotation:yTurn(Math.PI/2)}]),{center:!1,shine:.7})]})}function grapes(){const e=normalize(rounded(1.12,.5,2,16)),t=({u:e,v:t})=>{let o=mix([.3,.07,.27],[.17,.03,.17],smoothstep(.2,.9,noise(e,t,4,3)));return o=mix(o,[.52,.46,.62],.3*smoothstep(.35,.8,noise(e,t,9,6))),mix(o,[.36,.14,.25],.3*smoothstep(.6,.1,t))},o=lathe(e,{segments:seg(24),color:t}),s=lathe(e,{segments:seg(24),sweep:Math.PI,color:halfTurn(t),cutColor:e=>e>.93?[.3,.08,.25]:mix([.86,.9,.62],[.58,.68,.32],e*e),cutSteps:6}),r=[];for(let e=0;e<8;e++){const t=e/7,o=.32-.78*t,s=.26*Math.pow(1-t,.85)*(1-.35*Math.pow(1-t,6));for(const[t,n]of[[s,0],[.45*s,.5]]){const s=t<.03?n?0:1:Math.max(1,Math.floor(TAU*t/(1.85*.085)));for(let a=0;a<s;a++){const h=(a+n+.37*e)/s*TAU,i=hash(e,a+10*n);r.push({at:[Math.cos(h)*t,o+.04*(i-.5),Math.sin(h)*t],tint:shade([1,.95+.1*i,1],.85+.3*hash(a,e+3)),turn:2*i})}}}const n=[.17,.17,.17],a=e=>({geometry:o,position:e.at,scale:n,color:e.tint,rotation:mul(turn([0,0,1],.5*(e.turn-1)),yTurn(3*e.turn))}),h=e=>mix([.42,.35,.16],[.32,.22,.1],noise(e.u,e.v,4,6)),i=tube([[.02,.62,0],[0,.48,0],[.01,.3,0],[0,.1,0]],{radius:e=>.022-.008*e,sides:seg(8),color:h,capColor:[.55,.48,.3]}),m=[0,1,2,3].map(e=>{const t=e/4*TAU+.4;return{geometry:tube([[0,.42-.04*e,0],[.12*Math.cos(t),.36-.05*e,.12*Math.sin(t)],[.2*Math.cos(t),.3-.06*e,.2*Math.sin(t)]],{radius:.009,sides:seg(6),color:h})}}),l=[];for(let e=0;e<160;e++){const t=e/160*TAU,o=.22*(.6+.4*Math.pow(Math.abs(Math.cos(2.5*(t-Math.PI/2))),.7))*(1-.55*Math.exp(-Math.pow((t-Math.PI/2)/.22,2)))*(1+(e%4==0?.06:0));l.push([Math.cos(t)*o,Math.sin(t)*o-.05])}const u=recolor(extrude((new Path).addPolygon(l),{depth:.008}),({position:e})=>{const t=Math.atan2(e[1]+.05,e[0]),o=Math.min(...[0,1,2,3,4].map(e=>Math.abs(Math.sin(t-(Math.PI/2+e*TAU/5)))));return mix([.22,.48,.14],[.55,.72,.3],.8*smoothstep(.08,0,o*Math.hypot(e[0],e[1]+.05)*6))}),p=[];for(let e=0;e<=24;e++)p.push([-.04-.008*e,.56+.05*Math.sin(.8*e),.05*Math.cos(.8*e)]);const g=[{geometry:i},...m,{geometry:u,position:[.17,.56,-.06],rotation:mul(turn([0,1,0],-.4),turn([1,0,0],-.9))},{geometry:tube(p,{radius:.005,sides:seg(5),color:[.45,.6,.2]})}],M=merge([...r.map(a),...g]),f=e=>{const t=[];for(const o of r)Math.abs(o.at[0])<.0595?t.push({geometry:s,position:[0,o.at[1],o.at[2]],scale:n,color:o.tint,rotation:yTurn(e*Math.PI/2)}):Math.sign(o.at[0])===-e&&t.push(a(o));return 1===e?[...t,...g]:t};return withPieces({center:boxCenter(M),whole:_0x5a3f3a(M,{center:!1,shine:.4}),juice:[.75,.85,.45]},()=>[_0x5a3f3a(merge([{geometry:merge(f(1)),rotation:yTurn(-Math.PI/2)}]),{center:!1,shine:.4}),_0x5a3f3a(merge([{geometry:merge(f(-1)),rotation:yTurn(Math.PI/2)}]),{center:!1,shine:.4})])}function kiwi(){const e=normalize(rounded(1,.4,2.4,72)),t=({u:e,v:t})=>{let o=mix([.5,.35,.18],[.36,.24,.11],noise(e,t,12,8));return o=shade(o,.85+.3*hash(Math.floor(200*e),Math.floor(90*t))),mix(o,[.3,.2,.1],.6*(smoothstep(.05,0,t)+smoothstep(.95,1,t)))},o=(e,t)=>-.004*noise(e,t,60,30),s=turn([0,0,1],Math.PI/2),r=(e,t)=>{if(e>.975)return[.42,.3,.14];if(e>.94)return mix([.55,.72,.2],[.4,.58,.12],(e-.94)/.035);const o=noise(t/TAU,e,70,3);if(e<.26)return mix([.97,.96,.78],[.86,.9,.55],.6*smoothstep(.18,.26,e)+.1*o);const s=Math.floor(t/TAU*56),r=hash(s,7),n=Math.abs(fract(t/TAU*56)-.5)/56*TAU*e,a=.34+.06*r;if(Math.hypot(n/.016,(e-a)/.045)<1)return[.06,.05,.03];const h=mix([.62,.86,.22],[.44,.7,.08],smoothstep(.3,.9,e));return mix(h,[.85,.95,.5],.25*o*smoothstep(.95,.4,e))},n=merge([{geometry:lathe(e,{segments:seg(96),color:t,displace:o}),rotation:s}]);return withPieces({center:boxCenter(n),whole:_0x5a3f3a(n,{center:!1,shine:.05}),juice:[.6,.85,.25]},()=>{const s=e.slice(0,Math.floor(e.length/2)+1),n=_0x5a3f3a(merge([{geometry:lathe(s,{segments:seg(168),color:upperHalf(t),displace:upperDisplace(o),capColor:r,capRings:48}),rotation:CUT_ACROSS}]),{center:!1,shine:.45});return[n,n]})}const mangoShape=([e,t,o])=>[e-.22*t*t+.05*t,t,.8*o];function mango(){const e=normalize(profile(1,e=>.36*Math.sqrt(Math.max(0,1-Math.pow(2*e-1,2)))*(1.08-.2*e),64)),t=({u:e,v:t})=>{const o=Math.max(0,Math.cos(e*TAU))*smoothstep(.85,.15,t)+.4*noise(e,t,5,3)-.15;let s=mix([.42,.6,.16],[.96,.72,.15],.8*smoothstep(.95,.3,t)+.25*noise(e,t,4,3));return s=mix(s,[.98,.5,.12],.8*smoothstep(.1,.5,o)),s=mix(s,[.78,.12,.12],.85*smoothstep(.35,.85,o)),hash(Math.floor(110*e),Math.floor(60*t))>.965&&(s=mix(s,[.98,.9,.55],.5)),s},o=e[0][1],s=mangoShape([0,o,0]),r={geometry:stem(.05,.018,.01),position:[s[0],s[1]-.01,0]},n=merge([{geometry:warp(lathe(e,{segments:seg(72),color:t}),mangoShape)},r]),a=(e,t)=>{const o=Math.hypot(e/.24,t/.34);if(o<1)return mix([.98,.86,.5],[.9,.72,.32],.5*noise(e,t+1,3,40)+.4*o);const s=mix([1,.62,.08],[1,.76,.22],smoothstep(1,2.6,o));return mix(s,[.62,.7,.2],.6*smoothstep(.93,1,e))};return withPieces({center:boxCenter(n),whole:_0x5a3f3a(n,{center:!1,shine:.5}),juice:[1,.7,.15]},()=>{const o=merge([{geometry:warp(lathe(e,{segments:seg(72),sweep:Math.PI,color:halfTurn(t),cutColor:a,cutSteps:32}),mangoShape)},r]),s=_0x5a3f3a(o,{center:!1,shine:.4});return[s,s]})}const peachShape=([e,t,o])=>[e,t,o*(1-.09*Math.exp(-Math.pow(e/.08,2))*smoothstep(0,.3,o)*smoothstep(.48,.15,Math.abs(t+.03)))];function peach(){const e=normalize(resample(Path.fromSVG("M0 0.08 C 0.14 -0.02 0.48 -0.02 0.5 0.42 C 0.52 0.78 0.3 0.96 0.04 0.98 L 0 1.0").toContours()[0].map(([e,t])=>[e,-t]),64)),t=({u:e,v:t})=>{const o=smoothstep(.3,.8,.6*noise(e,t,5,4)+.6*Math.max(0,Math.cos((e-.75)*TAU)));let s=mix([1,.74,.3],[1,.62,.22],noise(e,t,10,6));return s=mix(s,[.92,.3,.2],.85*o),s=mix(s,[.7,.1,.12],o*smoothstep(.6,.9,noise(e,t,48,28))*.45),mix(shade(s,.97+.05*hash(Math.floor(220*e),Math.floor(110*t))),[1,.85,.7],.06)},o=e[0][1],s=[{geometry:stem(.05,.02,.01),position:[0,o-.015,0]},{geometry:leaf(.4,.07,{teeth:18,fold:.3}),position:[.01,o+.02,0],rotation:mul(turn([0,1,0],2.4),turn([0,0,1],.35))}],r=merge([{geometry:warp(lathe(e,{segments:seg(72),color:t}),peachShape)},...s]),n=(e,t)=>{const o=Math.hypot(e/.4,(t+.02)/.34);if(o<1)return mix([.55,.28,.14],[.36,.17,.08],smoothstep(.3,.7,noise(3*e,t+1,7,9)));let s=mix([1,.74,.3],[1,.82,.42],smoothstep(1.2,2.6,o));return s=mix(s,[.88,.3,.16],.85*smoothstep(1.35,1,o)),mix(s,[.85,.3,.18],.7*smoothstep(.94,1,e))};return withPieces({center:boxCenter(r),whole:_0x5a3f3a(r,{center:!1,shine:.12}),juice:[1,.75,.35]},()=>{const o=merge([{geometry:warp(lathe(undimpled(e),{segments:seg(72),sweep:Math.PI,color:halfTurn(t),cutColor:n,cutSteps:32,capColor:[.95,.5,.2]}),peachShape)},...s]),r=_0x5a3f3a(o,{center:!1,shine:.25});return[r,r]})}function pineapple(){const e=normalize(resample(rounded(1,.34,2.6,96),110)),t=(e,t)=>{const o=13*e+7*t,s=13*e-7*t;return{fa:fract(o),fb:fract(s),cell:31*Math.floor(o)+Math.floor(s)}},o=({u:e,v:o})=>{const{fa:s,fb:r,cell:n}=t(e,o),a=2*Math.max(Math.abs(s-.5),Math.abs(r-.5)),h=.8*smoothstep(.95,.3,o)+.3*hash(n,3);let i=mix([.42,.42,.12],[.86,.58,.14],h);return i=mix(i,[.64,.42,.14],.8*smoothstep(.45,.15,a)),Math.hypot(s-.62,r-.62)<.1&&(i=[.3,.2,.08]),mix(i,[.2,.18,.06],.85*smoothstep(.75,1,a))},s=(e,o)=>{const{fa:s,fb:r}=t(e,o),n=2*Math.max(Math.abs(s-.5),Math.abs(r-.5));return.018*(Math.sqrt(Math.max(0,1-n*n))-1)*smoothstep(0,.06,o)*smoothstep(1,.94,o)},r=e[0][1],n=e=>1/Math.sqrt(Math.cos(e*TAU)**2+(Math.sin(e*TAU)/.16)**2),a=[];[{n:7,tilt:.45,length:.62},{n:9,tilt:.8,length:.55},{n:11,tilt:1.15,length:.42},{n:9,tilt:1.45,length:.3}].forEach(({n:e,tilt:t,length:o},s)=>{for(let h=0;h<e;h++){const i=(h+.5*s)/e*TAU,m=o*(.85+.3*hash(h,s)),l=[];for(let e=0;e<=5;e++){const o=e/5,s=t+.5*o;l.push([Math.sin(s)*m*o,Math.cos(s)*m*o,0])}a.push({geometry:tube(l,{radius:e=>.045*Math.pow(1-e,.9)+.002,shape:n,sides:seg(10),smoothness:4,color:e=>mix(mix([.24,.42,.22],[.36,.55,.3],e.v),[.6,.55,.3],.7*smoothstep(.8,1,e.v))}),position:[0,r+.01,0],rotation:yTurn(i)})}});const h={geometry:merge(a)},i=merge([{geometry:lathe(e,{segments:seg(130),color:o,displace:s})},h]),m=(e,t)=>{if(e>.95)return[.55,.42,.14];const o=noise(t/TAU,e,90,4);return e>.86?Math.abs(fract(t/TAU*13*2)-.5)<.12&&e>.89?[.55,.35,.12]:[.96,.84,.45]:e<.2?mix([1,.92,.62],[.98,.86,.5],.4*o):shade(mix([1,.78,.18],[1,.84,.3],smoothstep(.8,.3,e)),.9+.15*o)};return withPieces({center:boxCenter(i),whole:_0x5a3f3a(i,{center:!1,shine:.3}),juice:[1,.85,.3]},()=>{const t=Math.floor(e.length/2),r=e.slice(0,t+1),n=e.slice(t),a={segments:seg(130),capColor:m,capRings:30};return[_0x5a3f3a(merge([{geometry:merge([{geometry:lathe(r,{...a,color:e=>o({u:e.u,v:.5*e.v}),displace:(e,t)=>s(e,.5*t)})},h]),rotation:CUT_ACROSS}]),{center:!1,shine:.3}),_0x5a3f3a(merge([{geometry:lathe(n,{...a,color:e=>o({u:e.u,v:.5+.5*e.v}),displace:(e,t)=>s(e,.5+.5*t)}),rotation:turn([1,0,0],Math.PI/2)}]),{center:!1,shine:.3})]})}function pomegranate(){const e=normalize(rounded(.9,.5,2,64)),t=({u:e,v:t})=>{let o=mix([.72,.1,.1],[.5,.04,.07],smoothstep(.3,.8,noise(e,t,6,4)));return o=mix(o,[.88,.5,.32],.55*smoothstep(.6,.85,noise(e+.3,t,5,3))),o=mix(o,[.45,.06,.06],.4*smoothstep(.7,.95,noise(e,t,60,30))),mix(o,[.62,.3,.2],.6*smoothstep(.08,0,t))},o=(e,t)=>-.008*Math.abs(Math.sin(e*TAU*3))*Math.sin(Math.PI*t),s=e[0][1],r=e=>mix([.6,.14,.12],[.42,.22,.12],smoothstep(.6,1,e.v)),n=[{geometry:tube([[0,s-.04,0],[0,s+.06,0]],{radius:e=>.07+.015*e,sides:seg(18),color:r,capColor:[.35,.12,.08]})}];for(let e=0;e<6;e++){const t=e/6*TAU;n.push({geometry:tube([[.07,0,0],[.09,.05,0],[.12,.1,0]],{radius:e=>.025*(1-e)+.002,sides:seg(6),color:r}),position:[0,s+.04,0],rotation:yTurn(t)})}const a=merge([{geometry:lathe(e,{segments:seg(72),color:t,displace:o})},...n]),h=e=>e>.95?[.62,.08,.09]:e>.88?[.98,.82,.68]:[.96,.9,.72];return withPieces({center:boxCenter(a),whole:_0x5a3f3a(a,{center:!1,shine:.45}),juice:[.8,.05,.15]},()=>{const s=e.slice(0,Math.floor(e.length/2)+1),r=s[s.length-1][0],a=lathe(rounded(1.2,.5,2,8),{segments:seg(8),color:[1,1,1]}),i=[],m=.052;for(let e=-1;e<=1;e+=m/r)for(let t=-1;t<=1;t+=m/r){const o=t+.04*(hash(13*t,7*e)-.5),s=e+.04*(hash(11*e,5*t)-.5)+Math.round(t/(m/r))%2*m/r/2,n=Math.hypot(o,s),h=Math.atan2(s,o),l=Math.abs(Math.sin(3*h+.3))*n;if(n>.84||n<.1||l<.05)continue;const u=hash(31*o,17*s);i.push({geometry:a,position:[o*r,-.006,s*r],rotation:mul(yTurn(u*TAU),turn([1,0,0],Math.PI/2+.6*(u-.5))),scale:[.044,.05,.03],color:mix([.85,.06,.14],[.62,.02,.1],u)})}const l=merge([{geometry:merge([{geometry:lathe(s,{segments:seg(72),color:upperHalf(t),displace:upperDisplace(o),capColor:h,capRings:12})},...n,...i]),rotation:CUT_ACROSS}]),u=_0x5a3f3a(l,{center:!1,shine:.55});return[u,u]})}function papaya(){const e=normalize(profile(1,e=>.25*Math.pow(Math.max(0,1-Math.pow(Math.abs(2*e-1),2.2)),1/2.2)*(.7+.42*e),72)),t=(e,t)=>-.006*Math.pow(Math.abs(Math.cos(e*TAU*2.5)),3)*Math.sin(Math.PI*t),o=({u:e,v:t})=>{const o=smoothstep(.35,.8,.7*t+.55*noise(e,t,5,6));let s=mix([.3,.5,.14],[.98,.7,.16],o);return s=mix(s,[.95,.5,.12],o*smoothstep(.55,.85,noise(e,t,8,10))*.5),hash(Math.floor(140*e),Math.floor(90*t))>.97&&(s=mix(s,[.25,.35,.1],.5)),mix(s,[.4,.5,.18],.6*smoothstep(.06,0,t))},s=turn([0,0,1],-Math.PI/2),r=e[0][1],n=merge([{geometry:merge([{geometry:lathe(e,{segments:seg(72),color:o,displace:t})},{geometry:stem(.04,.02,0),position:[0,r-.01,0],color:[1.3,1.6,.9]}]),rotation:s}]),a=e=>Math.max(0,.5*Math.sin(Math.PI*smoothstep(.25,-.42,e))),h=(e,t)=>{const o=a(t);return e>.96?[.5,.6,.15]:e<o?mix([.5,.12,.07],[.95,.42,.22],smoothstep(.75,1,e/o)):mix([1,.5,.26],[1,.62,.34],smoothstep(o,.9,e))};return withPieces({center:boxCenter(n),whole:_0x5a3f3a(n,{center:!1,shine:.4}),juice:[1,.55,.3]},()=>{const r=[];for(let t=0;t<90;t++){const o=.2-.58*hash(t,1),s=a(o)*radiusAt(e,o)*.85;if(s<.025)continue;const n=(2*hash(t,2)-1)*s;r.push({geometry:lathe(rounded(1,.5,2,8),{segments:seg(10)}),position:[n,o,.004+.01*hash(t,3)],scale:.042,color:[.06,.05,.04]})}const n=merge([{geometry:merge([{geometry:lathe(e,{segments:seg(72),sweep:Math.PI,color:halfTurn(o),displace:(e,o)=>t(.5*e,o),cutColor:h,cutSteps:24})},...r]),rotation:s}]),i=_0x5a3f3a(n,{center:!1,shine:.45});return[i,i]})}const sliced=new WeakSet;function withPieces(e,t){let o;const s=detail;return Object.defineProperty(e,"pieces",{get:()=>(!o&&(o=(()=>{detail=s;try{return t()}finally{detail=1}})(),t=void 0,sliced.add(e)),o),enumerable:!0})}const BUILDERS={apple:apple,orange:orange,lemon:lemon,pear:pear,strawberry:strawberry,watermelon:watermelon,banana:banana,cherries:cherries,grapes:grapes,kiwi:kiwi,mango:mango,peach:peach,pineapple:pineapple,pomegranate:pomegranate,papaya:papaya},built=new Map;export function getFruit(e,t=1){const o=e+"@"+t;let s=built.get(o);if(!s){let r;const n=()=>{detail=t;try{return BUILDERS[e]()}finally{detail=1}},a=cacheGameAsset("fruit:"+o+":whole",()=>(r=n(),{whole:r.whole,center:r.center,juice:r.juice}));let h;s=Object.defineProperty({...a},"pieces",{enumerable:!0,get:()=>(!h&&(h=cacheGameAsset("fruit:"+o+":pieces",()=>(r??=n()).pieces),r=void 0,sliced.add(s)),h)}),built.set(o,s)}return s}export const isFruitBuilt=(e,t=1,o=!1)=>{const s=built.get(e+"@"+t);return void 0!==s&&(!o||sliced.has(s))};export function loadFruits(e,t,o=1){const s=e.filter(e=>!built.has(e+"@"+o));let r=0,n=!1;const a=()=>{if(n)return;const e=s.shift();e&&getFruit(e,o),s.length?r=requestAnimationFrame(a):t()};return r=requestAnimationFrame(a),()=>{n=!0,cancelAnimationFrame(r)}}let fruits;export function getFruits(){if(!fruits){const e={};for(const t of Object.keys(BUILDERS))Object.defineProperty(e,t,{get:()=>getFruit(t),enumerable:!0});fruits=e}return fruits}export function*warmAssets(e,t,o=!1){for(const s of e)yield()=>getFruit(s,t).whole,o&&(yield()=>getFruit(s,t).pieces)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{createElement,memo,useEffect,useRef,useState}from"react";import{AppState}from"react-native";import{GameThemeProvider}from"../../helpers/GameTheme.js";import{GameAssetLoader}from"../../services/GameAssetLoader.js";import{areGameAssetsReady,gameAssetStages}from"../../services/GameAssets.js";import{DEFAULT_GAME_SETTINGS}from"../../services/UtilsService.js";import{EngineReadyContext}from"./EngineReadyContext.js";import{GameLoading}from"./GameLoading.js";import{GameLoadingTransition}from"./GameLoadingTransition.js";import{jsx as _0x290751,jsxs as _0x501bf1}from"react/jsx-runtime";export function withGameLoading(e,t){let r;const s=memo(function(s){const a={...DEFAULT_GAME_SETTINGS,...s.settings},[n,i]=useState(()=>areGameAssetsReady(e,a.theme)?r:void 0),[o,m]=useState("Getting ready"),[d,u]=useState(!1),l=useRef(null),f=useRef(!1);useEffect(()=>{if(n)return;f.current=!1,u(!1);const s=new GameAssetLoader([...gameAssetStages(e,a.theme),{label:"Ready for playtime",*tasks(){yield()=>{r=t()}}}],m,()=>i(()=>r),e=>{f.current=!0,u(!0)});l.current=s;const o=()=>{"active"!==AppState.currentState||f.current?s.pause():s.start()},d=AppState.addEventListener("change",o);return o(),()=>{s.dispose(),l.current=null,d.remove()}},[n,a.theme]);const g=!n&&a.isVisible?require("../../helpers/GameSettingsModal").GameSettingsModal:null;return _0x501bf1(GameThemeProvider,{theme:a.theme,children:[_0x290751(GameLoadingTransition,{ready:!!n,loader:_0x290751(GameLoading,{gameId:e,theme:a.theme,offset:a.offset,visible:!a.isVisible,label:o,error:d,onRetry:()=>{f.current=!1,u(!1),"active"===AppState.currentState&&l.current?.start()}}),children:n&&_0x290751(EngineReadyContext.Provider,{value:!0,children:createElement(n,s)})}),g&&_0x290751(g,{gameId:e,settings:a,onSettingsChange:s.onSettingsChange})]})});return s.displayName="Loading("+e+")",s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{c as _0x5b2eee}from"react/compiler-runtime";import _0x1c4231,{useCallback,useContext,useEffect,useLayoutEffect,useMemo,useRef,useState}from"react";import{AppState,BackHandler,StyleSheet,Text,View}from"react-native";import{audio,GameView,isEngineAvailable,warmUpEngine,World}from"@nayan-ui/engine";import{GameSettingsModal,GameThemeProvider}from"../../helpers/index.js";import{GAMES_METADATA}from"../../services/GamesMetadata.js";import{GAME_SOUNDS,playSound,preloadSounds,stopAllSounds}from"../../services/SoundsService.js";import{resolveGameTheme}from"../../services/ThemeService.js";import{DEFAULT_GAME_SETTINGS}from"../../services/UtilsService.js";import{EngineHud}from"./EngineHud.js";import{EngineReadyContext}from"./EngineReadyContext.js";import{toRgb}from"./EngineUtils.js";import{GamePlayingContext,useGamePlaying}from"./GameActivity.js";import{GameLoading}from"./GameLoading.js";import{GameLoadingTransition}from"./GameLoadingTransition.js";import{useGameResource}from"./useGameResource.js";import{jsx as _0x43dc7b,jsxs as _0x468bf5}from"react/jsx-runtime";let soundOwner;const logStats=e=>{};export const EngineGameScreen=({gameId:e,hudCapacity:t,errorMessage:n,feedback:o,choices:s,onAudioChange:a,onActiveChange:r,settings:i=DEFAULT_GAME_SETTINGS,onSettingsChange:l,onShare:u,onShowLeaderboard:d,bannerAd:m,background:g,onUpdate:h,onResize:S,columns:f,playing:p,subtext:E,onStart:b,onStop:v,gameOver:y,children:A,source:G,...x})=>{useGamePlaying(p);const _=resolveGameTheme(i.theme),T=i.offset??0;useEffect(()=>preloadSounds([GAME_SOUNDS.STOP,GAME_SOUNDS.RESET]),[]);const w=useRef({}).current,[C,R]=useState(()=>"background"!==AppState.currentState&&"inactive"!==AppState.currentState);useEffect(()=>{const e=AppState.addEventListener("change",e=>R("active"===e));return()=>e.remove()},[]);const O=C&&!i.isVisible&&!i.paused&&!x.paused&&!n;useEffect(()=>{r?.(O)},[O,r]);const L=O&&i.enableSounds;useEffect(()=>(soundOwner=w,audio.muted=!L,L||stopAllSounds(),a?.(L),()=>{a?.(!1),soundOwner===w&&(stopAllSounds(),audio.muted=!1,soundOwner=void 0)}),[L,a,w]);const P=useGameResource(()=>new EngineHud(_,t),e=>()=>e.dispose()),[j,M]=useState(null),U=useCallback(e=>{const{width:t,height:n}=e.nativeEvent.layout;M(e=>e&&e.width===t&&e.height===n?e:{width:t,height:n})},[]),D=useRef(S);D.current=S,useEffect(()=>{j&&(D.current?.(j.width,j.height,T),P.layout(j.width,j.height,T))},[P,j,T]),useLayoutEffect(()=>P.setTheme(_),[P,_]),useEffect(()=>P.setChoices(s??[]),[P,s]);const N=useRef(o);N.current=o;const V=useRef(h);V.current=h;const k=useCallback(e=>{if(i.isVisible)return G instanceof World&&G.update(0),void P.update(0);V.current?.(e,P),P.update(e,N.current)},[P,G,i.isVisible]);P.setActions({onStart:()=>{stopAllSounds(),b()},onStop:()=>{stopAllSounds(),v(),playSound(GAME_SOUNDS.STOP,i.enableSounds)},onShare:u,onShowLeaderboard:d});const B=f.map(e=>[e.label,e.value,e.color,e.valueColor,e.lives?.count,e.lives?.max].join("\0")).join("\x01");useEffect(()=>P.setColumns(f),[P,B]),useLayoutEffect(()=>P.setPlaying(p,E),[P,p,E]);const I=useRef(i.enableSounds);I.current=i.enableSounds;const H=useRef(y);H.current=y;const F=y?[y.title,y.message,y.scoreLabel,y.score,y.buttonText,!!y.onShare].join("\0"):null,[K,W]=useState(null);useEffect(()=>{const e=H.current;if(!e)return P.hideGameOver(),void W(null);P.showGameOver({...e,onPlayAgain:()=>{stopAllSounds(),H.current?.onPlayAgain(),playSound(GAME_SOUNDS.RESET,I.current)},onShare:e.onShare?()=>H.current?.onShare?.():void 0}),W(P.gameOverBanner)},[P,F,j,_]);const z=useCallback(e=>{P.setGameOverReserve(e.nativeEvent.layout.height),W(P.gameOverBanner)},[P]),X=null!==y;useEffect(()=>{if(!X)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(H.current?.onPlayAgain(),!0));return()=>e.remove()},[X]);const q=useMemo(()=>toRgb(_.BACKGROUND),[_.BACKGROUND]);return _0x468bf5(View,{pointerEvents:i.paused?"none":"auto",style:[styles.root,{backgroundColor:_.BACKGROUND}],onLayout:U,children:[G?_0x43dc7b(GameView,{...x,paused:x.paused||!!n||i.paused&&p||!C,source:G,background:g??q,onUpdate:k,overlay:P.world,onOverlayTouch:P.touch,onPrimaryAction:()=>P.activatePrimary(),onStats:__DEV__?logStats:void 0}):null,X?null:A,n&&_0x43dc7b(View,{pointerEvents:"none",style:styles.error,children:_0x43dc7b(Text,{accessibilityRole:"alert",style:{color:_.TEXT},children:n})}),X&&m&&K?_0x43dc7b(View,{pointerEvents:"box-none",style:[styles.banner,{top:K.top,width:K.width,left:((j?.width??0)-K.width)/2}],children:_0x43dc7b(View,{onLayout:z,children:m})}):null,_0x43dc7b(GameSettingsModal,{gameId:e,settings:i,onSettingsChange:l})]})};export function engineGame(e,t){const n=_0x1c4231.memo(n=>{const o=_0x5b2eee(22),s=useContext(EngineReadyContext),[a,r]=useState(s),[i,l]=useState(null);let u,d;o[0]!==s?(u=()=>{if(!isEngineAvailable||s)return;let e=!0;return warmUpEngine().then(()=>{e&&r(!0)},t=>{e&&l(t instanceof Error?t.message:String(t))}),()=>{e=!1}},d=[s],o[0]=s,o[1]=u,o[2]=d):(u=o[1],d=o[2]),useEffect(u,d);const m=n.settings??DEFAULT_GAME_SETTINGS,g=isEngineAvailable&&a,h=!m.isVisible,S=!!i||!isEngineAvailable,f=i??(isEngineAvailable?void 0:"This game needs the Nayan engine, which is not available in this build.");let p,E,b,v,y;return o[3]!==m.offset||o[4]!==m.theme||o[5]!==h||o[6]!==S||o[7]!==f?(p=_0x43dc7b(GameLoading,{gameId:e,theme:m.theme,offset:m.offset,visible:h,error:S,message:f}),o[3]=m.offset,o[4]=m.theme,o[5]=h,o[6]=S,o[7]=f,o[8]=p):p=o[8],o[9]!==n||o[10]!==m?(E=_0x43dc7b(t,{...n,settings:m}),o[9]=n,o[10]=m,o[11]=E):E=o[11],o[12]!==n.onPlayingChange||o[13]!==E?(b=_0x43dc7b(GamePlayingContext.Provider,{value:n.onPlayingChange,children:E}),o[12]=n.onPlayingChange,o[13]=E,o[14]=b):b=o[14],o[15]!==g||o[16]!==p||o[17]!==b?(v=_0x43dc7b(View,{style:styles.root,children:_0x43dc7b(GameLoadingTransition,{ready:g,loader:p,children:b})}),o[15]=g,o[16]=p,o[17]=b,o[18]=v):v=o[18],o[19]!==m.theme||o[20]!==v?(y=_0x43dc7b(GameThemeProvider,{theme:m.theme,children:v}),o[19]=m.theme,o[20]=v,o[21]=y):y=o[21],y});return n.displayName=GAMES_METADATA[e].title,n}const styles=StyleSheet.create({root:{flex:1},error:{position:"absolute",top:"45%",alignSelf:"center",padding:24},banner:{position:"absolute",alignItems:"center",overflow:"hidden",borderRadius:10}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const MAX_GAME_WIDTH=500;export const gameWidthFor=t=>Math.min(t-30,500);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const MAX_GAME_WIDTH=420;export const gameWidthFor=t=>Math.min(t-48,420);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{merge,shapeGeometry,tube}from"@nayan-ui/engine";import{cacheGameAsset,createGameMesh as _0x3ac2a4}from"./EngineMeshes.js";export const GLYPH_RADIUS=.1;export const GLYPH_ADVANCE=.72;export const GLYPH_WIDTH=.6;const line=(e,n,s,i)=>({points:[[e,n],[s,i]]}),curve=(...e)=>({points:e}),loop=(e,n,s,i,l=16)=>({closed:!0,points:Array.from({length:l+3},(t,o)=>{const r=Math.PI/2+(o-1)/l*Math.PI*2;return[e+Math.cos(r)*s,n+Math.sin(r)*i]})}),arc=(e,n,s,i,l,t,o=12)=>({points:Array.from({length:o+1},(r,h)=>{const a=(l+(t-l)*h/o)*Math.PI/180;return[e+Math.cos(a)*s,n+Math.sin(a)*i]})}),SIX=[[.5,.9],[.32,.98],[.13,.86],[.05,.52],[.08,.2],[.28,.02],[.5,.11],[.56,.32],[.42,.54],[.2,.55],[.06,.38]],P_BOWL=curve([.06,1],[.38,1],[.54,.88],[.54,.62],[.38,.48],[.06,.48]),STROKES={0:[loop(.3,.5,.26,.47)],1:[line(.1,.76,.34,.97),line(.34,.97,.34,.03)],2:[curve([.05,.76],[.16,.93],[.33,.98],[.5,.89],[.55,.7],[.44,.5],[.05,.03]),line(.05,.03,.57,.03)],3:[curve([.06,.86],[.26,.98],[.48,.91],[.52,.72],[.28,.54]),curve([.28,.54],[.53,.4],[.55,.18],[.34,.02],[.05,.12])],4:[line(.42,.03,.42,.97),line(.42,.97,.03,.32),line(.03,.32,.6,.32)],5:[line(.54,.97,.13,.97),line(.13,.97,.08,.55),curve([.08,.55],[.3,.62],[.52,.5],[.56,.26],[.4,.04],[.18,.03],[.04,.14])],6:[{points:SIX}],7:[line(.03,.97,.58,.97),curve([.58,.97],[.38,.55],[.24,.03])],8:[loop(.3,.75,.21,.22),loop(.3,.27,.26,.26)],9:[{points:SIX.map(([e,n])=>[.6-e,1-n])}],A:[line(.02,0,.3,1),line(.3,1,.58,0),line(.13,.36,.47,.36)],B:[line(.06,0,.06,1),curve([.06,1],[.36,1],[.5,.91],[.5,.68],[.36,.54],[.06,.54]),curve([.06,.54],[.4,.54],[.56,.42],[.56,.13],[.4,0],[.06,0])],C:[arc(.33,.5,.29,.49,48,312)],D:[line(.06,0,.06,1),curve([.06,1],[.3,1],[.5,.86],[.56,.5],[.5,.14],[.3,0],[.06,0])],E:[line(.06,0,.06,1),line(.06,1,.54,1),line(.06,.52,.44,.52),line(.06,0,.54,0)],F:[line(.06,0,.06,1),line(.06,1,.54,1),line(.06,.52,.44,.52)],G:[arc(.32,.5,.28,.49,48,352),line(.6,.43,.36,.43)],H:[line(.06,0,.06,1),line(.54,0,.54,1),line(.06,.52,.54,.52)],I:[line(.3,0,.3,1),line(.12,1,.48,1),line(.12,0,.48,0)],J:[line(.2,1,.54,1),curve([.44,1],[.44,.26],[.37,.06],[.22,0],[.08,.07],[.04,.22])],K:[line(.06,0,.06,1),line(.54,1,.06,.38),line(.25,.58,.56,0)],L:[line(.06,1,.06,0),line(.06,0,.54,0)],M:[line(.02,0,.06,1),line(.06,1,.3,.36),line(.3,.36,.54,1),line(.54,1,.58,0)],N:[line(.06,0,.06,1),line(.06,1,.54,0),line(.54,0,.54,1)],O:[loop(.3,.5,.28,.48)],P:[line(.06,0,.06,1),P_BOWL],Q:[loop(.3,.5,.28,.48),line(.36,.24,.6,-.02)],R:[line(.06,0,.06,1),P_BOWL,line(.28,.48,.56,0)],S:[curve([.54,.86],[.42,.98],[.24,.99],[.08,.88],[.08,.68],[.3,.53],[.52,.38],[.54,.14],[.38,.01],[.18,.01],[.04,.14])],T:[line(.02,1,.58,1),line(.3,1,.3,0)],U:[curve([.06,1],[.06,.3],[.14,.07],[.3,0],[.46,.07],[.54,.3],[.54,1])],V:[line(.02,1,.3,0),line(.3,0,.58,1)],W:[line(0,1,.14,0),line(.14,0,.3,.64),line(.3,.64,.46,0),line(.46,0,.6,1)],X:[line(.04,0,.56,1),line(.04,1,.56,0)],Y:[line(.02,1,.3,.5),line(.58,1,.3,.5),line(.3,.5,.3,0)],Z:[line(.04,1,.56,1),line(.56,1,.04,0),line(.04,0,.56,0)]};export const hasGlyph=e=>e in STROKES;const meshes=new Map;export function glyphMesh(e){return cacheGameAsset("shared/EngineGlyphs:glyphMesh"+JSON.stringify([e]),()=>glyphMeshUncached(e))}function glyphMeshUncached(e){let n=meshes.get(e);if(!n){const s=STROKES[e];if(!s)throw new Error('glyphMesh: no glyph for "'+e+'"');const i=[];for(const{points:e,closed:n}of s){const s=e.map(([e,n])=>[e-.3,n-.5,0]);if(i.push({geometry:tube(s,{radius:.1,sides:8,smoothness:5})}),!n)for(const e of[s[0],s[s.length-1]])i.push({geometry:shapeGeometry("sphere"),position:e,scale:.2})}n=_0x3ac2a4(merge(i),{center:!1,shine:.2}),meshes.set(e,n)}return n}const flatMeshes=new Map;export function flatGlyphMesh(e,n=1){return cacheGameAsset("shared/EngineGlyphs:flatGlyphMesh"+JSON.stringify([e,n]),()=>flatGlyphMeshUncached(e,n))}function flatGlyphMeshUncached(e,n=1){const s=1===n?e:e+"@"+n;let i=flatMeshes.get(s);if(!i){const l=STROKES[e];if(!l)throw new Error('flatGlyphMesh: no glyph for "'+e+'"');const t=[];for(const{points:e,closed:s}of l){const i=e.map(([e,n])=>[e-.3,n-.5,0]);if(t.push({geometry:tube(i,{radius:.1*n,sides:8,smoothness:5})}),!s)for(const e of[i[0],i[i.length-1]])t.push({geometry:shapeGeometry("sphere"),position:e,scale:.2*n})}i=_0x3ac2a4(merge([{geometry:merge(t),scale:[1,1,.05]}]),{center:!1,shine:0}),flatMeshes.set(s,i)}return i}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{extrude,loadFont,measureText,Path,World}from"@nayan-ui/engine";import{PLAY_PATH,SHARE_PATH,TROPHY_PATH}from"../../helpers/IconPaths.js";import{formatTime,getGameDimensions}from"../../services/UtilsService.js";import{cardBackdropMesh}from"./EngineBackdrop.js";import{fitControlSubtitle}from"./EngineControlText.js";import{cacheGameAsset,createGameMesh as _0x597f1b}from"./EngineMeshes.js";import{gameWidthFor,toColor}from"./EngineUtils.js";const CAPACITY=900,BOARD_PAD_V=14,BOARD_RADIUS=18,LABEL_SIZE=12,VALUE_SIZE=24,LABEL_SPACING=1.2,BOARD_HEIGHT=68,ROW_PAD_V=20,ROW_PAD_H=16,ROW_GAP=20,MAIN_HEIGHT=60,ICON_SIZE=56,BUTTON_TEXT=16,BUTTON_SUBTEXT=10,PULSE=1.05,PRESSED=.95,Z_OVER=40,CARD_PAD=20,TROPHY=48,TITLE_SIZE=28,MESSAGE_SIZE=14,SCORE_LABEL_SIZE=13,SCORE_SIZE=44,PROMPT_SIZE=15,PLAY_SIZE=17,SHARE_SIZE=16,RESULT_BUTTON=52,COUNT_DELAY=.2,COUNT_TIME=.9,SHARE_PROMPT="Share your goals with your family and friends and challenge them to beat your score!";export const getScoreBoardTop=(t=0)=>t>0?t+15:15;export const getSceneInputInsets=(t=0)=>({top:getScoreBoardTop(t)+68+10,bottom:95});export const scoreColumn=(t,e="SCORE",s=t=>t.toLocaleString())=>({label:e,value:s(t)});export const timerColumn=(t,e,s=30,o="TIMER")=>{const i=Math.max(0,Math.ceil(t));return{label:o,value:formatTime(i),valueColor:i<=s?e.DANGER:void 0}};export const livesColumn=(t,e,s="LIVES")=>({label:s,value:t+"/"+e,lives:{count:t,max:e}});export const textColumn=(t,e,s)=>({label:t,value:String(e),color:s});const HEART_PATH="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",HEART_SIZE=20,HEART_GAP=2,HEART_ON="#E53935",HEART_OFF="#2B2B2B",meshes=new Map,cached=(t,e)=>{let s=meshes.get(t);return!s&&(s=cacheGameAsset("shared/EngineHud:"+t,e),meshes.set(t,s)),s},panelMesh=(t,e,s)=>{const[o,i]=[Math.round(t),Math.round(e)];return cached("hud-panel:"+o+":"+i+":"+s,()=>_0x597f1b(extrude((new Path).addRoundedRect(-o/2,-i/2,o,i,Math.min(s,o/2,i/2)),{depth:0}),{center:!1}))},ringMesh=(t,e,s,o)=>{const[i,h]=[Math.round(t),Math.round(e)];return cached("hud-ring:"+i+":"+h+":"+s+":"+o,()=>{const t=Math.min(s,i/2,h/2),e=(new Path).addRoundedRect(-i/2,-h/2,i,h,t).addRoundedRect(-i/2+o,-h/2+o,i-2*o,h-2*o,Math.max(0,t-o));return _0x597f1b(extrude(e,{depth:0,fillRule:"evenodd"}),{center:!1})})},iconMesh=(t,e)=>cached("hud-icon:"+t,()=>_0x597f1b(extrude(Path.fromSVG(e),{depth:0}),{fit:1})),trophyMesh=()=>iconMesh("trophy",TROPHY_PATH),shareMesh=()=>iconMesh("share",SHARE_PATH),playMesh=()=>iconMesh("play",PLAY_PATH),heartMesh=()=>iconMesh("heart",HEART_PATH),TROPHY_INK=.875,SHARE_INK=415/512,PLAY_INK=332/512;let fonts=null,fontsLoading=null;const HUD_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.,:!?'%/+-\xb7\xd7\xf7\u2026";export function loadHudFonts(){return fontsLoading??=loadFont(require("../../assets/fonts/Inter-SemiBold.ttf"),{depth:0,chars:HUD_CHARS}).then(t=>fonts={semi:t,regular:t}),fontsLoading}function textWidth(t,e,s=0,o="semi"){const i=fonts?.[o];return i?measureText(i,t,{letterSpacing:s/e})*e:0}function wrap(t,e,s,o){const i=[];let h="";for(const n of t.split(/\s+/)){const t=h?h+" "+n:n;h&&textWidth(t,e,0,o)>s?(i.push(h),h=n):h=t}return h&&i.push(h),i}const columnKey=t=>t.value+"\0"+(t.color??"")+"\0"+(t.valueColor??"")+"\0"+(t.lives?t.lives.count+"/"+t.lives.max:"");function spawnText(t,e,s,o,i,h,n,r=0,a="semi",l=!1){return t.spawn({text:s,font:fonts[a],parent:e,position:[o,i,2],scale:h,color:n,letterSpacing:r/h,tabular:l,pickable:!1})}export class EngineHud{size={width:0,height:0,offset:0};columns=[];playing=!1;subtext="Begin playing!";actions={onStart:()=>{},onStop:()=>{}};board=null;controls=null;values=[];buttons=[];pressed=null;over=null;overReserve=0;disposed=!1;feedback=null;waiting=null;layers=new Map;choices=[];choiceRoot=null;choiceButtons=[];choicePage=0;get ready(){return!this.disposed&&!!fonts&&this.size.width>0}get viewport(){return this.size}layer(t){let e=this.layers.get(t);return void 0===e&&(e=this.world.spawn({mesh:"none",position:[0,0,5],pickable:!1}),this.layers.set(t,e)),e}clearLayer(t){const e=this.layers.get(t);void 0!==e&&this.world.despawn(e),this.layers.delete(t)}text(t,e,s,o,i,h){return spawnText(this.world,t,e,s,o,i,h)}rectangle(t,e,s,o,i,h,n=0){return this.world.spawn({mesh:panelMesh(1,1,0),parent:t,position:[e,s,n],scale:[o,i,1],color:h,pickable:!1})}setChoices(t){const e=t.length!==this.choices.length||t.some((t,e)=>{const s=this.choices[e];return t.id!==s?.id||t.label!==s.label||t.selected!==s.selected});this.choices=t,e&&this.buildChoices()}buildChoices(){if(null!==this.choiceRoot&&this.world.despawn(this.choiceRoot),this.choiceRoot=null,this.choiceButtons=[],!this.ready||!this.choices.length)return;const{width:t,height:e}=this.size,s=Math.ceil(this.choices.length/3);this.choicePage=Math.min(this.choicePage,s-1);const o=this.world.spawn({mesh:"none",position:[0,0,6],pickable:!1});this.choiceRoot=o;const i=Math.min(t-24,500),h=(i-24)/5,n=e-getSceneInputInsets().bottom-22,r=(e,s,r,a=!1)=>{const l=(t-i)/2+h/2+s*(h+6),d=this.panel(o,l,n,h,36,12,a?this.theme.SOLID:this.theme.SURFACE);spawnText(this.world,d,e,0,0,Math.min(12,(h-8)/Math.max(1,e.length)/.65),toColor(a?this.theme.ON_SOLID:this.theme.TEXT)),this.choiceButtons.push({id:"choice",x:l-h/2,y:n-18,w:h,h:36,root:d,action:r})};r("<",0,()=>{this.choicePage=(this.choicePage+s-1)%s,this.buildChoices()}),this.choices.slice(3*this.choicePage,3*(this.choicePage+1)).forEach((t,e)=>r(t.label,e+1,()=>this.choices.find(e=>e.id===t.id)?.onPress(),t.selected)),r(">",4,()=>{this.choicePage=(this.choicePage+1)%s,this.buildChoices()})}constructor(t,e=900){this.world=new World(e),this.theme=t,loadHudFonts().then(()=>{this.disposed||(this.buildBoard(),this.buildControls(),this.buildChoices(),this.waiting&&this.buildOver(this.waiting,!0),this.waiting=null)}).catch(t=>{})}setActions(t){const e=!!t.onShare!=!!this.actions.onShare||!!t.onShowLeaderboard!=!!this.actions.onShowLeaderboard;this.actions=t,e&&this.buildControls()}layout(t,e,s){t===this.size.width&&e===this.size.height&&s===this.size.offset||(this.size={width:t,height:e,offset:s},this.layoutFeedback(),this.buildBoard(),this.buildControls(),this.buildChoices(),this.over&&this.buildOver(this.over.card,!1))}setTheme(t){t!==this.theme&&(this.theme=t,this.clearFeedback(),this.buildBoard(),this.buildControls(),this.buildChoices(),this.over&&this.buildOver(this.over.card,!1))}setColumns(t){const e=t.length===this.columns.length&&t.every((t,e)=>t.label===this.columns[e].label);if(this.columns=t,!e||this.values.length!==t.length)return this.buildBoard();t.forEach((t,e)=>{const s=this.values[e],o=columnKey(t);s.key===o||this.disposed||null===this.board||(this.world.despawn(s.entity),s.entity=this.spawnValue(this.board,t,s.x,s.y),s.key=o)})}setPlaying(t,e=this.subtext){t===this.playing&&e===this.subtext||(this.playing=t,this.subtext=e,this.buildControls())}update(t,e){if(this.disposed)return;e&&this.showFeedback(e);const s=this.over;if(s&&s.elapsed<1.1){s.elapsed+=t;const e=Math.min(1,Math.max(0,(s.elapsed-.2)/.9));this.setOverScore(Math.round(s.card.score*(1-(1-e)**3)))}this.world.update(t)}showFeedback(t){if(this.size.width&&fonts){if(!this.over&&!this.waiting&&(t.flash||t.message)){const e=this.feedback??={root:this.world.spawn({mesh:"none",position:[0,0,35],pickable:!1}),flash:null,message:null,text:""};if(t.flash){e.flash??=this.world.spawn({mesh:panelMesh(1,1,0),parent:e.root,pickable:!1});const t=toColor(this.theme.DANGER,.6);this.world.stopAnimation(e.flash),this.world.set(e.flash,{color:t}),this.world.animate(e.flash,{color:[t[0],t[1],t[2],0]},{duration:.4})}if(t.message){e.text!==t.message&&null!==e.message&&(this.world.despawn(e.message),e.message=null);const s=toColor(this.theme.SCORE_HIGHLIGHT);e.text=t.message,e.message??=spawnText(this.world,e.root,e.text,0,0,30,s),this.world.stopAnimation(e.message),this.world.set(e.message,{color:s}),this.world.animate(e.message,{color:[s[0],s[1],s[2],0]},{duration:.9})}this.layoutFeedback()}t.flash=!1,t.message=void 0}}layoutFeedback(){const t=this.feedback;if(!t)return;const{width:e,height:s,offset:o}=this.size;null!==t.flash&&this.world.set(t.flash,{position:[e/2,-s/2,0],scale:[e,s,1]}),null!==t.message&&this.world.set(t.message,{position:[e/2,-(getScoreBoardTop(o)+68+14+15),2]})}clearFeedback(){this.feedback&&!this.disposed&&this.world.despawn(this.feedback.root),this.feedback=null}showGameOver(t){this.clearFeedback();const e=this.over;e&&e.card.title===t.title&&e.card.message===t.message&&e.card.score===t.score&&!!e.card.onShare==!!t.onShare?e.card=t:fonts?this.buildOver(t,!0):this.waiting=t}hideGameOver(){this.waiting=null,this.over&&(this.disposed||this.world.despawn(this.over.root),this.pressed&&this.over.buttons.includes(this.pressed)&&(this.pressed=null),this.over=null)}get gameOverBanner(){return this.over?{top:this.over.bannerTop,width:this.over.bannerWidth}:null}setGameOverReserve(t){Math.abs(t-this.overReserve)<1||(this.overReserve=t,this.over&&this.buildOver(this.over.card,!1))}touch=(t,e,s)=>{if("start"===t){const t=(this.over?this.over.buttons:[...this.buttons,...this.choiceButtons]).find(t=>e>=t.x&&e<=t.x+t.w&&s>=t.y&&s<=t.y+t.h);return t?(this.pressed=t,this.world.animate(t.root,{scale:.95},{duration:.08}),!0):null!==this.over}if("move"===t||!this.pressed)return!0;const o=this.pressed;this.pressed=null;const i=e>=o.x-10&&e<=o.x+o.w+10&&s>=o.y-10&&s<=o.y+o.h+10;return this.release(o),"end"===t&&i&&(o.action?o.action():this.fire(o.id)),!0};dispose(){this.disposed||(this.disposed=!0,this.world.dispose())}release(t){"main"!==t.id||this.playing||t.action?this.world.animate(t.root,{scale:1},{duration:.12}):this.pulse(t.root)}pulse(t){this.world.set(t,{scale:1}),this.world.animate(t,{scale:1.05},{duration:1,repeat:"forever",yoyo:!0})}fire(t){"main"===t?(this.playing&&this.clearFeedback(),(this.playing?this.actions.onStop:this.actions.onStart)()):"share"===t?this.actions.onShare?.():this.actions.onShowLeaderboard?.()}panel(t,e,s,o,i,h,n=this.theme.SURFACE,r=this.theme.BORDER){const a=this.theme,l=this.world.spawn({mesh:"none",...null!==t&&{parent:t},position:[e,-s,0],pickable:!1}),d=a.BORDER_WIDTH??0;return d>0&&this.world.spawn({mesh:ringMesh(o,i,h,d),parent:l,position:[0,0,.5],color:toColor(r),pickable:!1}),this.world.spawn({mesh:panelMesh(o-2*d,i-2*d,h-d),parent:l,position:[0,0,0],color:toColor(n),pickable:!1}),l}setOverScore(t){const e=this.over;if(!e)return;const s=(e.card.formatter??(t=>t.toLocaleString()))(t);s===e.scoreText&&null!==e.scoreEntity||(null!==e.scoreEntity&&this.world.despawn(e.scoreEntity),e.scoreText=s,e.scoreEntity=spawnText(this.world,e.scoreParent,s,0,e.scoreY,44,toColor(this.theme.SCORE_HIGHLIGHT),0,"semi",!0))}buildOver(t,e){const s=this.over&&!e?this.over.elapsed:0;this.hideGameOver();const{width:o,height:i}=this.size;if(this.disposed||!o||!fonts)return;const h=this.theme,n=Math.min(getGameDimensions().width,o-30),r=n-40,a=t.message?wrap(t.message,14,r,"regular"):[],l=t.onShare?wrap(SHARE_PROMPT,15,r+30,"regular"):[],d=110+(a.length?4+20*a.length+16:20)+104+24+(l.length?25*l.length+5+12:0)+52+(this.overReserve>0?12+this.overReserve:0)+20,p=Math.max(10,(i-d)/2),u=o/2,m=this.world.spawn({mesh:"none",position:[0,0,40],pickable:!1}),w=this.world.spawn({mesh:panelMesh(o,i,0),parent:m,position:[o/2,-i/2,0],color:e?toColor(h.OVERLAY,0):toColor(h.OVERLAY),pickable:!1}),g=this.world.spawn({mesh:"none",parent:m,position:[u,-(p+d/2),2],pickable:!1});this.world.spawn({mesh:cardBackdropMesh(h,n,d,16),parent:g,position:[-Math.round(n)/2,Math.round(d)/2,0],color:[1,1,1,1],pickable:!1});const b=t=>d/2-t,f=t=>this.world.spawn({mesh:"none",parent:g,position:[0,b(t),1],pickable:!1});let T=20;const E=f(T+24);if(this.world.spawn({mesh:trophyMesh(),parent:E,position:[0,0,0],scale:42,color:[1,1,1,1],pickable:!1}),T+=56,spawnText(this.world,f(T+17),t.title,0,0,28,toColor(h.TEXT),1),T+=34,a.length){T+=4;for(const t of a)spawnText(this.world,f(T+10),t,0,0,14,toColor(h.TEXT_SUBTLE),0,"regular"),T+=20;T+=16}else T+=20;const S=b(T+52),v=f(T+52),x=Math.max(200,Math.min(r,260)),y=this.panel(v,0,0,x,104,16);spawnText(this.world,y,t.scoreLabel.toUpperCase(),0,28,13,toColor(h.TEXT_SUBTLE),1,"semi"),T+=128;const R=b(T),M=f(T);let A=0;for(const t of l)spawnText(this.world,M,t,0,-(A+12.5),15,toColor(h.TEXT_SUBTLE),0,"regular"),A+=25;l.length&&(A+=17);const C=[],_=A+26,O=-r/2,P=t.onShare?2*(r-10)/5:0,H=t.onShare?r-10-P:r,L=(t,e,s,o,i,h,n,r,a,l,d)=>{const m=this.panel(M,t+e/2,_,e,52,26,s,o),w=Math.min(h,h*(e-44)/Math.max(1,textWidth(i,h,.5,n))),g=textWidth(i,w,.5,n),b=-(g+26)/2+9;this.world.spawn({mesh:a,parent:m,position:[b,0,2],scale:18*l,color:r,pickable:!1}),spawnText(this.world,m,i,b+9+8+g/2,0,w,r,.5,n),C.push({id:"main",x:u+t,y:p+T+_-26,w:e,h:52,root:m,action:d})};if(t.onShare&&L(O,P,h.SURFACE,h.BORDER,"Share",16,"semi",toColor(h.TEXT),shareMesh(),SHARE_INK,()=>this.over?.card.onShare?.()),L(O+(t.onShare?P+10:0),H,h.SOLID,h.SOLID,t.buttonText,17,"semi",toColor(h.ON_SOLID),playMesh(),PLAY_INK,()=>this.over?.card.onPlayAgain()),A+=52,this.over={card:t,root:m,scoreParent:y,scoreY:-10,scoreText:"",scoreEntity:null,elapsed:s,buttons:C,bannerTop:p+T+A+12,bannerWidth:r},this.setOverScore(e?0:t.score),e){this.world.animate(w,{color:toColor(h.OVERLAY)},{duration:.16}),this.world.set(g,{scale:.85}),this.world.animate(g,{scale:1},{spring:"bouncy"}),this.world.set(E,{scale:0}),this.world.animate(E,[{scale:1.18},{scale:1}],{delay:.09,duration:.35,easing:"back"});for(const[t,e,s]of[[v,S,.2],[M,R,.33]])this.world.set(t,{position:[0,e-18,1]}),this.world.animate(t,{position:[0,e,1]},{delay:s,spring:!0})}}buildBoard(){if(this.disposed)return;null!==this.board&&this.world.despawn(this.board),this.board=null,this.values=[];const{width:t,offset:e}=this.size;if(!t||!fonts)return;const s=gameWidthFor(t),o=getScoreBoardTop(e),i=this.panel(null,t/2,o+34,s,68,18);this.board=i;const h=this.columns.length,n=toColor(this.theme.LABEL);this.columns.forEach((t,e)=>{const o=-s/2+s*(e+.5)/h;spawnText(this.world,i,t.label,o,14,12,t.color?toColor(t.color):n,1.2,"semi"),this.values.push({entity:this.spawnValue(i,t,o,-8),key:columnKey(t),x:o,y:-8})})}activatePrimary(){this.ready&&(this.over?this.over.card.onPlayAgain():this.fire("main"))}spawnValue(t,e,s,o){if(!e.lives)return spawnText(this.world,t,e.value,s,o,24,toColor(e.valueColor??e.color??this.theme.TEXT),0,"semi",!0);const{count:i,max:h}=e.lives,n=this.world.spawn({mesh:"none",parent:t,position:[s,o,2],pickable:!1}),r=gameWidthFor(this.size.width)/this.columns.length-12,a=Math.min(20,Math.max(6,(r-2*(h-1))/Math.max(1,h))),l=a+2;for(let t=0;t<h;t++){const e=(t-(h-1)/2)*l;this.world.spawn({mesh:heartMesh(),parent:n,position:[e,0,0],scale:a,color:toColor(t<i?HEART_ON:"#2B2B2B"),pickable:!1})}return n}buildControls(){if(this.disposed)return;null!==this.controls&&this.world.despawn(this.controls),this.controls=null,this.buttons=[],this.pressed=null;const{width:t,height:e}=this.size;if(!t||!fonts)return;const s=Math.min(getGameDimensions().width,t),o=(t-s)/2+16,i=(t+s)/2-16,h=e-5-20-30,n=this.world.spawn({mesh:"none",position:[0,0,10],pickable:!1});this.controls=n;const r=toColor(this.theme.TEXT);let a=o,l=i;const d=(t,e,s,o)=>{const i=this.panel(n,e,h,56,56,28);this.world.spawn({mesh:s,parent:i,position:[0,0,2],scale:24*o,color:r,pickable:!1}),this.buttons.push({id:t,x:e-28,y:h-28,w:56,h:56,root:i})};this.actions.onShowLeaderboard&&(d("leaderboard",o+28,trophyMesh(),.875),a+=76),this.actions.onShare&&(d("share",i-28,shareMesh(),SHARE_INK),l-=76);const p=l-a,u=(a+l)/2,m=this.panel(n,u,h,p,60,30);spawnText(this.world,m,this.playing?"STOP GAME":"START GAME",0,7,16,r,1);const w=fitControlSubtitle(this.playing?"Stop current game":this.subtext,Math.max(0,p-24),t=>textWidth(t,10,.5));spawnText(this.world,m,w,0,-12,10,toColor(this.theme.LABEL),.5,"semi"),this.buttons.push({id:"main",x:a,y:h-30,w:p,h:60,root:m}),this.playing||this.pulse(m)}}export function*warmAssets(){yield trophyMesh,yield shareMesh,yield playMesh,yield heartMesh}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{extrude,measureText,merge,Path,World}from"@nayan-ui/engine";import{GAMES_METADATA}from"../../services/GamesMetadata.js";import{GAME_IDS}from"../../services/UtilsService.js";import{cacheGameAsset,createGameMesh}from"./EngineMeshes.js";import{frontLight,toColor,toRgb}from"./EngineUtils.js";const palette=(t,o,e,s,i,r,a)=>({sky:t,horizon:o,ground:e,accent:s,second:i,text:r,muted:a}),LOOKS={[GAME_IDS.TREASURE_HUNT]:{scene:"forest",tag:"INTO THE WILD",message:"Follow the river. Find the diamonds.",dark:palette("#0D2420","#234332","#142E25","#AED492","#9BDCE8","#F0F7E9","#BED0B9"),light:palette("#E5EDDF","#BDCFAC","#95B18A","#386747","#347C8B","#253C2B","#51674F")},[GAME_IDS.PENGUIN_RUN]:{scene:"penguin",tag:"JUNGLE DASH",message:"Through the jungle. Over the ruins.",dark:palette("#112B28","#2C4B3D","#172C28","#FFBD58","#95B484","#FFF7E8","#C8D1BC"),light:palette("#E7EBDD","#C1D0AB","#8DA988","#916027","#446C48","#2C3B31","#596A52")},[GAME_IDS.CAR_RACING]:{scene:"car",tag:"START YOUR ENGINES",message:"Your red racer. A fresh stretch of road.",dark:palette("#111C29","#293948","#151E28","#FF6A68","#F1CC7A","#F6F5ED","#BEC6CD"),light:palette("#ECF0F3","#CAD6DD","#A5B4BC","#B93038","#88703F","#27333E","#5C6A73")},[GAME_IDS.BIKE_RACING]:{scene:"bike",tag:"READY TO RIDE",message:"Lean in. The open road awaits.",dark:palette("#121E28","#2C3A43","#16222A","#FFA153","#E9D4A5","#FBF5EB","#C8C9BE"),light:palette("#EDF0EC","#CCD8D5","#A3B5AB","#A3551B","#786846","#2C3835","#5A6A61")},[GAME_IDS.FRUIT_NINJA]:{scene:"ninja",tag:"SLICE INTO ACTION",message:"Fresh fruit. One perfect slice.",dark:palette("#152C24","#35513B","#1C3026","#FFAA82","#B8D492","#FFF7E9","#C8D3B9"),light:palette("#EEF1DE","#CDDBB5","#A1B582","#AA4734","#476A39","#334329","#616E4C")},[GAME_IDS.FRUIT_MERGER]:{scene:"merger",tag:"SMALL FRUIT. BIG FUN.",message:"Drop. Match. Make something bigger.",dark:palette("#241D37","#443459","#2B233D","#FFBE79","#ECCF9B","#FFF5E7","#D6C8E1"),light:palette("#F1EAF5","#E1D4EB","#CDBFDD","#9C5728","#A35568","#43304E","#75617F")},[GAME_IDS.TILE_HOME]:{scene:"tiles",tag:"THREE OF A KIND",message:"A perfect little match is waiting.",dark:palette("#241F38","#44365D","#2D2540","#CAB0F1","#F2DCB9","#FFF8EE","#D5C9E4"),light:palette("#F3EDF6","#E3D9EE","#D0C4DE","#75528E","#937341","#44334F","#786685")},[GAME_IDS.PLAY_WITH_TUA]:{scene:"tua",tag:"YOUR PLAYFUL COMPANION",message:"Wave, laugh and play with Tua.",dark:palette("#281F3D","#493763","#21333A","#D0AFF2","#8ED4C5","#FCF4FF","#D3C4E5"),light:palette("#F2EAF9","#DCCDEC","#C3DDD5","#8055AB","#347F76","#473255","#766282")},[GAME_IDS.CHAMELEON_RUN]:{scene:"chameleon",tag:"SWITCH. JUMP. RUN.",message:"Yellow or pink? Find your rhythm.",dark:palette("#1A2A38","#344A5B","#1C2D3A","#FFD447","#F653A6","#FFF7E2","#C6D2D8"),light:palette("#E9F0F0","#CBDEE0","#AEC7CD","#8D6921","#B63B7D","#30454F","#5E7480")},[GAME_IDS.PAPER_IO]:{scene:"paper",tag:"MAKE YOUR MARK",message:"Paint your path. Claim your world.",dark:palette("#221F33","#3B354C","#28263B","#88D693","#F58B8B","#F5F6EF","#C7CED1"),light:palette("#F0EDF5","#DDD7E7","#C9C4D8","#3B7D47","#B4474D","#364438","#65706C")},[GAME_IDS.CROSSY_ROAD]:{scene:"crossing",tag:"ONE HOP AT A TIME",message:"Watch the traffic. Make your move.",dark:palette("#1A2B2E","#344D43","#294732","#EDD785","#9AC984","#FCF6E3","#CDD5BE"),light:palette("#EAF0E7","#C7D8BC","#9BBB80","#886727","#4A7544","#34462E","#617454")}},DEFAULT=LOOKS[GAME_IDS.TILE_HOME];export function loadingLook(t,o){const e=LOOKS[t]??{...DEFAULT,tag:"READY FOR A NEW ROUND",message:"A little playtime is on its way."};return{...e,colours:"light"===o?e.light:e.dark}}export const LOADING_LIGHT=frontLight([0,0,1],1);const primitives=new Map;function shape(t,o,e=!1){let s=primitives.get(t);return!s&&(s=cacheGameAsset("loading:"+t,()=>{const t=extrude(o(),{depth:0});return createGameMesh(e?merge([{geometry:t,scale:[1,-1,1]}]):t,{center:!1})}),primitives.set(t,s)),s}const circle=()=>shape("circle",()=>(new Path).addCircle(0,0,.5)),rect=()=>shape("rect",()=>(new Path).addRoundedRect(-.5,-.5,1,1,.12)),vector=(t,o)=>shape(t,()=>Path.fromSVG(o),!0),STAR="M0 11L3 3L11 0L3-3L0-11L-3-3L-11 0L-3 3Z",DIAMOND="M-20 3L-10 16H10L20 3L0-23Z",LEAF="M0 0Q-5 24 25 20Q24-3 0 0Z",PINE="M0 65L-24 23H-12L-31-5H-16L-39-35H39L16-5H31L12 23H24Z",gradients=new Map;function background(t){const o=t.sky+":"+t.horizon+":"+t.ground;let e=gradients.get(o);return!e&&(e=cacheGameAsset("loading:gradient:"+o,()=>{const o=[],e=[];for(const[e,s]of[t.sky,t.horizon,t.ground].entries()){const[t,i,r]=toColor(s);for(const s of[0,1])o.push(s,-e/2,0,0,0,1,t,i,r,0,0)}for(let t=0;t<2;t++){const o=2*t;e.push(o,o+2,o+1,o+1,o+2,o+3)}return createGameMesh({vertices:new Float32Array(o),indices:new Uint32Array(e)},{center:!1})}),gradients.set(o,e)),e}export function loadingPlacement(t,o,e=0){const s=Math.max(.1,Math.min((t-30)/360,(o-e-24)/620)),i=e+Math.max(12,(o-e-590*s)/2);return{scale:s,top:i,retryBounds:{left:t/2-90*s,top:i+542*s,width:180*s,height:46*s}}}export class EngineLoading{world=new World(512);camera={eye:[200,-425,100],target:[200,-425,0],fov:1,ortho:425};statusText=null;messageText=[];motions=[];status={label:"",error:!1,retry:!1,reducedMotion:!0};disposed=!1;retryBox={left:0,top:0,width:0,height:0};constructor(t,o,e){this.font=e,this.look=loadingLook(t,o);const s=this.look.colours;this.clearColor=toRgb(s.sky),this.backdrop=this.world.spawn({mesh:background(s),pickable:!1}),this.content=this.world.spawn({mesh:"none",position:[200,-70,5],pickable:!1});for(let t=0;t<7;t++)this.disc(this.content,175*Math.sin(2.4*t),25+75*t,45+13*t,45+13*t,toColor(t%2?s.accent:s.second,.055),-1);this.box(this.content,0,28,230,32,toColor(s.accent,.14)),this.text(this.content,this.look.tag,0,28,10,s.accent,210);const i=this.world.spawn({mesh:"none",parent:this.content,position:[0,-215,4],pickable:!1});this.disc(i,0,105,245,25,toColor("#000000",.16),-2),this.drawHero(i),this.motion(i,{moveBy:[0,7,0]},{duration:1.5,repeat:"forever",yoyo:!0,easing:"easeInOut"},{position:[0,-215,4]});for(const[t,o]of[-140,140,-112,114].entries()){const e=this.path(i,"star",STAR,o,t%2?-67:-110,t%2?s.second:s.accent,.5+.1*t);this.motion(e,{scale:.85+.12*t},{duration:.9+.12*t,repeat:"forever",yoyo:!0},{scale:.5+.1*t})}this.text(this.content,GAMES_METADATA[t].title,0,385,30,s.text,330),this.text(this.content,this.look.message,0,425,13,s.muted,330),this.progress=this.world.spawn({mesh:"none",parent:this.content,position:[0,-485,5],pickable:!1}),this.box(this.progress,0,0,290,14,toColor(s.accent,.14));const r=this.box(this.progress,-108,0,64,10,toColor(s.accent));this.motion(r,{position:[108,0,1]},{duration:1.3,repeat:"forever",yoyo:!0,easing:"easeInOut"},{position:[-108,0,1]});for(let t=0;t<3;t++){const o=this.disc(this.progress,15*t-15,62,6,6,toColor(s.accent,.5));this.motion(o,{scale:[9,9,1],color:toColor(s.accent,1)},{duration:.55,delay:.16*t,repeat:"forever",yoyo:!0},{scale:[6,6,1],color:toColor(s.accent,.5)})}this.retryButton=this.world.spawn({mesh:"none",parent:this.content,position:[0,-565,6],scale:0,pickable:!1}),this.box(this.retryButton,0,0,180,46,toColor(s.accent)),this.text(this.retryButton,"Try again",0,0,16,s.sky,160)}box(t,o,e,s,i,r,a=1){return this.world.spawn({mesh:rect(),parent:t,position:[o,-e,a],scale:[s,i,1],color:r,pickable:!1})}disc(t,o,e,s,i,r,a=1){return this.world.spawn({mesh:circle(),parent:t,position:[o,-e,a],scale:[s,i,1],color:r,pickable:!1})}path(t,o,e,s,i,r,a=1,n=2){return this.world.spawn({mesh:vector(o,e),parent:t,position:[s,-i,n],scale:a,color:toColor(r),pickable:!1})}text(t,o,e,s,i,r,a=330){const n=measureText(this.font,o);return this.world.spawn({text:o,font:this.font,parent:t,position:[e,-s,10],scale:Math.min(i,a/Math.max(1,n)),color:toColor(r),pickable:!1})}motion(t,o,e,s){this.motions.push({entity:t,target:o,options:e,initial:s})}tree(t,o,e,s,i){this.box(t,o,e+35,7*s,70*s,toColor("#75604B")),this.path(t,"pine",PINE,o,e,i,s)}fruit(t,o,e,s,i){this.disc(t,o,e,s,s,toColor(i)),this.disc(t,o-.22*s,e-.18*s,.18*s,.3*s,toColor("#FFFFFF",.3),2),this.path(t,"leaf",LEAF,o,e-.45*s,"#74BA65",s/75,3)}drawHero(t){const o=this.look.colours,e=this.look.scene;if(("forest"===e||"penguin"===e||"ninja"===e)&&(this.disc(t,0,82,310,88,toColor("#426C48")),this.disc(t,12,103,275,35,toColor("#284F39")),this.tree(t,-112,-3,.9,"#578257"),this.tree(t,110,10,.85,"#345E44"),this.tree(t,-73,-28,.58,"#81A96C")),"forest"===e)return this.path(t,"river","M-45-105Q20-65-20-30Q-60 5 4 28L16 12Q-31-3-4-24Q42-62-24-110Z",0,0,"#6EBACB",1,2),this.box(t,-5,55,67,12,toColor("#DFCAA0"),3),this.path(t,"diamond",DIAMOND,8,-60,"#A9EBF7",2,5),void this.path(t,"diamond",DIAMOND,120,62,"#D2F8FF",.55,5);if("car"===e||"bike"===e||"crossing"===e){for(let e=0;e<6;e++){const s=55*e-142,i=45+e%3*23;this.box(t,s,25-i/2,42,i,toColor(o.horizon,.8),-1);for(let e=0;e<2;e++)for(let r=0;r<2;r++)this.box(t,s-9+18*r,20-i+14+18*e,7,8,toColor(o.second,.6),0)}this.box(t,0,76,320,51,toColor("#303C47")),this.box(t,0,52,320,3,toColor("#F1D998")),this.box(t,0,100,320,3,toColor("#F1D998"));for(let o=-140;o<=140;o+=70){const e=this.box(t,o,76,34,3,toColor("#FFFFFF",.6));this.motion(e,{moveBy:[-24,0,0]},{duration:.8,repeat:"forever",easing:"linear"},{position:[o,-76,1]})}if("car"===e){this.box(t,0,10,218,66,toColor("#EF575B"),3),this.path(t,"roof","M-72 0L-46 47H39L79 0Z",0,-23,"#D94248",1,4),this.path(t,"window","M-48 0L-31 29H-5V0ZM5 0V29H29L53 0Z",0,-33,"#BCE0E5",1,5),this.box(t,-94,8,22,12,toColor("#FFE5AA"),6),this.box(t,97,10,14,16,toColor("#FFD49B"),6);for(const o of[-66,66])this.disc(t,o,44,49,49,toColor("#253342"),6),this.disc(t,o,44,24,24,toColor("#C9D2D5"),7)}else if("bike"===e){for(const e of[-78,78])this.disc(t,e,43,70,70,toColor("#263444"),3),this.disc(t,e,43,47,47,toColor("#C8D5D8"),4),this.disc(t,e,43,34,34,toColor(o.sky),5);this.path(t,"bike-frame","M-78-43L-28 12L27-43H15L-27-3L-66-43ZM-18 20H35L82-43H70L30 8H-18Z",0,0,"#F9A54D",1,6),this.box(t,7,-30,70,17,toColor("#293B48"),7),this.box(t,-13,-5,63,35,toColor("#E97143"),6),this.path(t,"rider","M-9 2L-27 45L5 68L28 36L13 28L3 43L-8 35L8 8Z",0,-45,"#4B91B3",1,8),this.disc(t,6,-87,45,45,toColor("#FFD177"),9),this.box(t,15,-88,32,15,toColor("#31434F"),10)}else{this.box(t,-55,-19,111,48,toColor("#E78459"),4);for(const o of[-90,-23])this.disc(t,o,5,25,25,toColor("#263444"),5);this.disc(t,77,-4,58,68,toColor("#FFF8E7"),6),this.disc(t,93,-30,39,39,toColor("#FFF8E7"),7),this.box(t,115,-27,20,12,toColor("#EDB44C"),8)}return}if("penguin"===e){this.disc(t,0,5,108,140,toColor("#1E2D43"),3),this.disc(t,0,20,73,95,toColor("#FFF8ED"),4),this.disc(t,0,-67,94,90,toColor("#192A40"),5),this.disc(t,0,-61,77,60,toColor("#FFF8ED"),6);for(const o of[-21,21])this.disc(t,o,-67,21,26,toColor("#5394D8"),7),this.disc(t,o,-66,10,15,toColor("#162539"),8);return this.path(t,"beak","M-14 5H14L0-10Z",0,-40,"#FFB542",1,9),this.disc(t,-27,78,42,18,toColor("#F7AE42"),5),void this.disc(t,27,78,42,18,toColor("#F7AE42"),5)}if("ninja"===e||"merger"===e)return this.fruit(t,-74,35,100,"#EE6465"),this.fruit(t,43,-8,117,"#F8B246"),this.fruit(t,115,61,66,"#A4CE68"),void("ninja"===e&&this.path(t,"slash","M-138-78Q-4-37 119 111L143 99Q19-61-126-91Z",0,0,"#ECFFF1",1,8));if("tua"===e){this.disc(t,0,49,95,106,toColor("#D2AAEE"),3),this.disc(t,0,-37,128,119,toColor("#DCC0F3"),5);for(const o of[-36,36])this.disc(t,o,-103,33,86,toColor("#DCC0F3"),3),this.disc(t,o,-104,14,55,toColor("#F7C7D9"),4);this.disc(t,0,-13,75,51,toColor("#FFF2E4"),6);for(const o of[-25,25])this.disc(t,o,-43,13,19,toColor("#382B51"),7),this.disc(t,o-2,-47,4,6,[1,1,1,1],8);return this.disc(t,0,-19,15,10,toColor("#A06C94"),8),this.disc(t,-57,37,31,67,toColor("#B996DF"),2),this.disc(t,57,37,31,67,toColor("#B996DF"),2),this.disc(t,-29,101,51,25,toColor("#B996DF"),4),void this.disc(t,29,101,51,25,toColor("#B996DF"),4)}if("chameleon"===e)return this.path(t,"chameleon-step","M-140-60H-55V-30H-140ZM-15-15H60V15H-15ZM100 35H156V65H100Z",0,0,"#F2C950",1,2),this.disc(t,8,-26,110,59,toColor("#ED67AD"),3),this.disc(t,67,-39,65,65,toColor("#F6D856"),4),this.disc(t,81,-55,30,30,toColor("#FFF8E8"),5),this.disc(t,85,-54,11,13,toColor("#3E3756"),6),void this.path(t,"tail","M-40 42Q-123 97-111 18Q-100-20-67 10Q-50 40-85 43L-84 29Q-68 29-78 18Q-94 6-97 23Q-105 74-47 29Z",0,0,"#ED67AD",1,4);const s=["#F3B655","#A98ADB","#7DC4AB","#ED8292","#73BBD6","#E7D365"];for(let o=0;o<2;o++)for(let e=0;e<3;e++){const i=87*(e-1),r=87*(o-.5);this.box(t,i+4,r+8,76,76,toColor("#000000",.16)),this.box(t,i,r,76,76,toColor(s[3*o+e])),this.path(t,"diamond",DIAMOND,i,r,"#FFFFFF",.65,4)}}layout(t,o,e=0){const{scale:s,top:i,retryBounds:r}=loadingPlacement(t,o,e);this.world.set(this.backdrop,{scale:[t,o,1]}),this.world.set(this.content,{position:[t/2,-i,5],scale:s}),this.camera.eye=[t/2,-o/2,100],this.camera.target=[t/2,-o/2,0],this.camera.ortho=o/2,this.retryBox=r}get retryBounds(){return this.retryBox}setStatus(t){if(this.disposed)return;const o=this.look.colours;if(t.label===this.status.label&&t.error===this.status.error||(null!==this.statusText&&this.world.despawn(this.statusText),this.statusText=this.text(this.content,t.error?"A little bump along the way":t.label+"\u2026",0,520,13,o.text,315)),t.message!==this.status.message||t.error!==this.status.error){for(const t of this.messageText)this.world.despawn(t);if(this.messageText=[],t.error&&t.message){const e=[];let s="";const i=t.message.slice(0,240).split(/\s+/).flatMap(t=>t.match(/.{1,40}/gu)??[]);for(const t of i){const o=s?s+" "+t:t;s&&12*measureText(this.font,o)>325?(e.push(s),s=t):s=o}s&&e.push(s);for(const[t,s]of e.slice(0,3).entries())this.messageText.push(this.text(this.content,s,0,452+16*t,12,o.muted,325))}}if(this.world.set(this.progress,{scale:t.error?0:1}),this.world.set(this.retryButton,{scale:t.error&&t.retry?1:0}),t.reducedMotion!==this.status.reducedMotion||t.error!==this.status.error)for(const o of this.motions)this.world.stopAnimation(o.entity),this.world.set(o.entity,o.initial),t.reducedMotion||t.error||this.world.animate(o.entity,o.target,o.options);this.status={...t}}update(t){this.disposed||this.world.update(t)}dispose(){this.disposed||(this.disposed=!0,this.world.dispose())}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{lathe,merge,quat,recolor,shapeGeometry,tube}from"@nayan-ui/engine";import{NIGHT_SCENE}from"../../services/ThemeService.js";import{toColor}from"../shared/EngineUtils.js";import{cacheGameAsset,createGameMesh as _0x5ec928}from"./EngineMeshes.js";const FOV=.9;export function makeView(e,t,o={}){const r=o.horizon??.62,s=Math.tan(.45),n=Math.atan(2*(r-.5)*s);return{width:e,height:t,eye:[0,o.eyeHeight??1.6,0],forward:[0,Math.sin(n),-Math.cos(n)],up:[0,Math.cos(n),Math.sin(n)],tanHalf:s,pitch:n,horizon:r,playDepth:o.playDepth??3.6}}export function cameraFor(e){const[t,o,r]=add(e.eye,scale(e.forward,e.playDepth));return{eye:[e.eye[0],e.eye[1],e.eye[2]],target:[t,o,r],fov:.9}}export const pointSize=(e,t=e.playDepth)=>2*t*e.tanHalf/e.height;export function at(e,t,o,r=e.playDepth){const s=pointSize(e,r),n=add(e.eye,scale(e.forward,r));return[n[0]+(t-e.width/2)*s,n[1]+(e.height/2-o)*s*e.up[1],n[2]+(e.height/2-o)*s*e.up[2]]}export function planeVector(e,t,o){const r=pointSize(e);return[t*r,-o*r*e.up[1],-o*r*e.up[2]]}export function facing(e,t=0){return quat.multiply(quat.x(e.pitch),quat.z(t))}export function rayThrough(e,t,o){const r=(t-e.width/2)/(e.height/2)*e.tanHalf,s=(e.height/2-o)/(e.height/2)*e.tanHalf;return normalize(add(add(e.forward,[r,0,0]),scale(e.up,s)))}export const add=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]];export const scale=(e,t)=>[e[0]*t,e[1]*t,e[2]*t];const normalize=e=>scale(e,1/(Math.hypot(e[0],e[1],e[2])||1)),night=e=>"dark"===e.mode,DAY_LIGHT={direction:[.55,.8,.45],ambient:.42,color:[1.08,1.02,.94],shadows:!0,shadowExtent:22},NIGHT_LIGHT={direction:[-.45,.75,.4],ambient:.64,color:[.92,.95,1.06],shadows:!0,shadowExtent:22};export const lightFor=e=>night(e)?NIGHT_LIGHT:DAY_LIGHT;const rgb=e=>{const[t,o,r]=toColor(e);return[t,o,r]},mix=(e,t,o)=>[e[0]+(t[0]-e[0])*o,e[1]+(t[1]-e[1])*o,e[2]+(t[2]-e[2])*o],SKY_DAY={zenith:rgb("#2a73c0"),mid:rgb("#6aaee0"),horizon:rgb("#d8edf6")},SKY_NIGHT={zenith:rgb("#07061a"),mid:rgb(NIGHT_SCENE.SKY[1]),horizon:rgb(NIGHT_SCENE.SKY[3])};export const HAZE=rgb("#c6e0ec");const NIGHT_TINT=[.72,.76,.92,1],DAY_TINT=[1,1,1,1];export const sceneryTint=e=>night(e)?NIGHT_TINT:DAY_TINT;const hash=(e,t)=>{const o=43758.5453*Math.sin(127.1*e+311.7*t);return o-Math.floor(o)},smooth=e=>e*e*(3-2*e);export function noise(e,t){const o=Math.floor(e),r=Math.floor(t),s=smooth(e-o),n=smooth(t-r),a=hash(o,r),h=hash(o+1,r),i=hash(o,r+1);return a+(h-a)*s+(i-a)*n+(a-h-i+hash(o+1,r+1))*s*n}export const fbm=(e,t)=>.55*noise(e,t)+.3*noise(2.1*e,2.1*t)+.15*noise(4.3*e,4.3*t);export function random(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}class Mesh{vertices=[];indices=[];vertex(e,t,o){return this.vertices.push(e[0],e[1],e[2],t[0],t[1],t[2],o[0],o[1],o[2],0,0),this.vertices.length/11-1}grid(e,t,o){const r=this.vertices.length/11;for(let r=0;r<e;r++)for(let e=0;e<t;e++){const{p:t,n:s,c:n}=o(r,e);this.vertex(t,s,n)}const s=(e,o)=>r+e*t+o;for(let o=0;o+1<e;o++)for(let e=0;e+1<t;e++)this.indices.push(s(o,e),s(o,e+1),s(o+1,e+1),s(o,e),s(o+1,e+1),s(o+1,e))}geometry(){return{vertices:new Float32Array(this.vertices),indices:new Uint32Array(this.indices)}}}const meshes=new Map,cached=(e,t)=>{let o=meshes.get(e);return!o&&(o=cacheGameAsset("shared/EngineMeadow:"+e,t),meshes.set(e,o)),o},SKY_RADIUS=420;function skyMesh(e){const t=night(e);return cached("meadow-sky:"+(t?"night":"day"),()=>{const o=lightFor(e),r=normalize(o.direction),s=.6+.4*(.5*r[1]+.5),n=o.ambient*s+(1-o.ambient),a=o.color??[1,1,1],h=t?SKY_NIGHT:SKY_DAY,i=new Mesh;return i.grid(14,24,(e,t)=>{const o=e/13*1.2-.12,s=t/23*2.5-1.25,i=Math.max(0,o)/1.08,l=i<.25?mix(h.horizon,h.mid,smooth(i/.25)):mix(h.mid,h.zenith,smooth((i-.25)/.75));return{p:[Math.sin(s)*Math.cos(o)*420,420*Math.sin(o),-Math.cos(s)*Math.cos(o)*420],n:r,c:[Math.min(1,l[0]/(n*a[0])),Math.min(1,l[1]/(n*a[1])),Math.min(1,l[2]/(n*a[2]))]}}),_0x5ec928(i.geometry(),{center:!1})})}const HILLS={meadow:[{distance:250,height:34,roughness:.012,colors:["#5f8a6e","#4b7560"],haze:.62},{distance:150,height:20,roughness:.02,colors:["#4f8a4a","#3b6e3c"],haze:.4},{distance:85,height:11,roughness:.035,colors:["#4a8f3c","#356f2c"],haze:.2}],desert:[{distance:250,height:40,roughness:.014,colors:["#c7a07e","#a9846a"],haze:.58,mesa:!0},{distance:150,height:26,roughness:.022,colors:["#c9875a","#a5643d"],haze:.36,mesa:!0},{distance:85,height:9,roughness:.04,colors:["#ddb27a","#c4925a"],haze:.16}]};function hillMesh(e,t="meadow"){return cached("meadow-hill:"+t+":"+e,()=>{const o=HILLS[t][e],r=rgb(o.colors[0]),s=rgb(o.colors[1]),n=new Mesh,a=1.3*o.distance;n.grid(3,90,(t,n)=>{const h=n/89*a*2-a,i=fbm(h*o.roughness+7*e,3.1*e),l=o.height*(o.mesa?Math.min(1,.25+3.2*Math.max(0,i-.35)):.35+.65*i),d=0===t?l:1===t?.45*l:-2,m=-o.distance-20*fbm(.01*h,e)+(0===t?0:4*t),g=0===t?r:mix(r,s,t/2);return{p:[h,d,m],n:normalize([0,.55,.85]),c:mix(g,HAZE,o.haze)}});const h=n.geometry();for(let e=0;e<h.indices.length;e+=3){const t=h.indices[e+1];h.indices[e+1]=h.indices[e+2],h.indices[e+2]=t}return _0x5ec928(h,{center:!1})})}function groundMesh(){return cached("meadow-ground",()=>{const e=rgb("#5fae3e"),t=rgb("#3c7f2a"),o=rgb("#9bb24a"),r=new Mesh;return r.grid(46,40,(r,s)=>{const n=-(Math.pow(1.13,r)-1)*(246/243)-.3,a=12+1.25*-n,h=s/39*a*2-a,i=fbm(.08*h,.08*n),l=noise(.5*h,.5*n);let d=mix(t,e,i);d=mix(d,o,1.5*Math.max(0,l-.7));const m=1-Math.exp(-((-n/170)**2));return{p:[h,0,n],n:[0,1,0],c:mix(d,HAZE,.75*m)}}),_0x5ec928(r.geometry(),{center:!1})})}const leafy=(e,t,o)=>({position:r})=>{const s=noise(9*r[0]+o,9*r[1]+7*r[2]);return mix(t,e,Math.min(1,Math.max(0,.25+.6*r[1]+.5*s)))},oakMesh=()=>cached("meadow-oak",()=>{const e=rgb("#6b4423"),t=shapeGeometry("sphere"),o=[[[0,.62,0],.46],[[-.2,.54,.06],.32],[[.22,.56,-.04],.34],[[.04,.82,.03],.32],[[-.12,.74,-.14],.28],[[.14,.72,.16],.28],[[-.24,.68,-.02],.24]].map(([e,t],o)=>({geometry:recolor(shapeGeometry("sphere"),leafy(rgb("#6fbf4a"),rgb("#24602a"),3.7*o)),position:e,scale:t}));return _0x5ec928(merge([{geometry:tube([[0,0,0],[.01,.25,0],[-.02,.5,.01]],{radius:e=>.055-.025*e,color:e})},...o,{geometry:t,position:[0,.01,0],scale:[.14,.03,.14],color:rgb("#5a3a1e")}]),{center:!1,shine:.05})});export const pineMesh=()=>cached("meadow-pine",()=>{const e=[0,1,2,3].map(e=>{const t=.18+.19*e,o=.3-.06*e;return{geometry:recolor(lathe([[o,t],[.55*o,t+.12],[.001,t+.3]],{segments:14}),leafy(rgb("#3f8a45"),rgb("#123d1d"),5.1*e))}});return _0x5ec928(merge([{geometry:tube([[0,0,0],[0,.4,0]],{radius:e=>.045-.02*e,color:rgb("#5a3a22")})},...e]),{center:!1})});export const bushMesh=()=>cached("meadow-bush",()=>_0x5ec928(merge([[[0,.22,0],.5],[[-.24,.16,.05],.36],[[.25,.17,-.03],.38],[[.05,.36,.04],.34]].map(([e,t],o)=>({geometry:recolor(shapeGeometry("sphere"),leafy(rgb("#77c24f"),rgb("#2d6b2a"),2.3*o)),position:e,scale:[t,.8*t,t]}))),{center:!1,shine:.08}));export const rockMesh=()=>cached("meadow-rock",()=>_0x5ec928(merge([{geometry:recolor(shapeGeometry("sphere"),({position:e})=>{const t=.48+.22*noise(6*e[0],6*e[1]+4*e[2]);return[t,.98*t,.92*t]}),scale:[1,.55,.8],position:[0,.18,0]}]),{center:!1,shine:.15}));export const tuftMesh=()=>cached("meadow-tuft",()=>{const e=random(7),t=Array.from({length:7},()=>{const t=e()*Math.PI*2,o=.05+.08*e(),r=.22+.14*e(),s=.08*(e()-.5),n=.08*(e()-.5);return{geometry:recolor(tube([[s,0,n],[s+Math.cos(t)*o*.4,.55*r,n+Math.sin(t)*o*.4],[s+Math.cos(t)*o,r,n+Math.sin(t)*o]],{radius:e=>.014*(1-e),sides:4,smoothness:3}),({position:e})=>mix(rgb("#2f6e22"),rgb("#9ad466"),Math.min(1,e[1]/.3)))}});return _0x5ec928(merge(t),{center:!1})});export const flowerMesh=()=>cached("meadow-flower",()=>{const e=shapeGeometry("sphere"),t=[0,1,2,3,4].map(t=>{const o=t/5*Math.PI*2;return{geometry:e,position:[.05*Math.cos(o),.2,.05*Math.sin(o)],scale:[.06,.025,.06],color:[1,1,1]}});return _0x5ec928(merge([{geometry:tube([[0,0,0],[.01,.2,0]],{radius:.006,sides:4,color:rgb("#3d7a2a")})},...t,{geometry:e,position:[0,.21,0],scale:.04,color:rgb("#ffd23f")}]),{center:!1})});const HOT_AIR_PATTERNS=[["#e8433b","#ffd34d"],["#2f7ae5","#ffffff"],["#7b4fd6","#ff8a3d"]],hotAirBalloonMesh=e=>cached("meadow-hot-air:"+e,()=>{const[t,o]=HOT_AIR_PATTERNS[e].map(rgb),r=lathe([[.08,.28],[.16,.36],[.3,.52],[.36,.66],[.35,.8],[.27,.93],[.12,1],[.001,1.01]],{segments:24,color:({u:e})=>Math.floor(12*e)%2?t:o}),s=[0,1,2,3].map(e=>{const t=e/4*Math.PI*2+Math.PI/4;return{geometry:tube([[.075*Math.cos(t),.28,.075*Math.sin(t)],[.05*Math.cos(t),.12,.05*Math.sin(t)]],{radius:.004,sides:3,color:rgb("#5a4630")})}});return _0x5ec928(merge([{geometry:r},...s,{geometry:shapeGeometry("roundedBox"),position:[0,.08,0],scale:[.11,.08,.11],color:rgb("#8a5a2b")}]),{center:!1,shine:.25})}),FLOWER_COLORS=["#FF6B9D","#FF5A5A","#B784FF","#6FA8FF","#FF9F43","#FFFFFF"].map(e=>toColor(e));export function spawnWorld(e,t,o,r={}){const[s,n]=r.sun??[.8,.2],[a,h]=r.clouds??[.1,.42],i=night(o),l=i?NIGHT_TINT:DAY_TINT,d=e=>[e[0]*l[0],e[1]*l[1],e[2]*l[2],e[3]??1],m=[],g=(t,o,r,s,n)=>m.push(e.spawn({mesh:t,position:o,scale:r,color:s,...n?{rotation:n}:{},pickable:!1})),p=random(42),u=e=>quat.y(e);g(skyMesh(o),t.eye,1,[1,1,1,1]);const f=rayThrough(t,t.width*s,t.height*n),M=add(t.eye,scale(f,380));if(i){g("puff",M,90,[1.3,1.3,1.9,.35]),g("sphere",M,15,[2.1,2.1,2.3]);for(let e=0;e<46;e++){const e=rayThrough(t,p()*t.width,p()*t.height*t.horizon*.82);g("sphere",add(t.eye,scale(e,395)),.7+1.1*p(),[2,2,2.2])}}else g("puff",M,170,[2.2,1.9,1.2,.5]),g("puff",M,70,[2.4,2.2,1.6,.85]),g("sphere",M,22,[2.6,2.35,1.7]);const y=i?[.66,.68,.84,.88]:[1.18,1.18,1.22,.92];for(let o=0;o<7;o++){const r=rayThrough(t,o/6*t.width*1.1-.05*t.width+60*(p()-.5),t.height*(a+p()*(h-a))),s=add(t.eye,scale(r,200+120*p())),n=22+18*p();for(let t=0;t<7;t++){const t=[(p()-.5)*n*2.2,(p()-.3)*n*.5,(p()-.5)*n*.6];m.push(e.spawn({mesh:"puff",position:add(s,t),scale:n*(.8+.7*p()),color:y,velocity:[.12,0,0],pickable:!1}))}}const b=r.biome??"meadow";HILLS[b].forEach((e,t)=>g(hillMesh(t,b),[0,0,0],1,d([1,1,1,1])));const x=r.near??!0,w=x&&(r.groundDetails??!0);x&&g(groundMesh(),[0,0,0],1,d([1,1,1,1]));for(let e=0;w&&e<26;e++){const e=-(26+50*p()),t=(2*p()-1)*(.62*-e+6),o=p()<.45,r=(o?8:6)+5*p();g(o?pineMesh():oakMesh(),[t,0,e],[r*(.85+.3*p()),r,r*(.85+.3*p())],d([1,1,1,1]),u(6.3*p()))}w&&(r.framingTrees??!0)&&(g(oakMesh(),[-4.6,0,-11],[8.5,8,8.5],d([1,1,1,1]),u(.6)),g(pineMesh(),[5.2,0,-14],[8,12,8],d([1,1,1,1]),u(1.9)));for(let e=0;w&&e<16;e++){const e=-(7+24*p()),t=(2*p()-1)*(.55*-e+2),o=1+1.4*p();g(bushMesh(),[t,0,e],[1.2*o,o,1.2*o],d([.9+.2*p(),1,.9,1]),u(6.3*p()))}for(let e=0;w&&e<7;e++){const e=-(6+20*p()),t=(2*p()-1)*(.5*-e+1.5),o=.35+.8*p();g(rockMesh(),[t,0,e],o,d([1,1,1,1]),u(6.3*p()))}for(let o=0;o<(r.hotAirBalloons??0);o++){const r=rayThrough(t,t.width*(.15+.7*p()),t.height*(a+.05+p()*(h-a))),s=add(t.eye,scale(r,70+60*p())),n=9+4*p();m.push(e.spawn({mesh:hotAirBalloonMesh(o%HOT_AIR_PATTERNS.length),position:s,scale:n,rotation:u(6.3*p()),color:d([1,1,1,1]),velocity:[.25+.2*p(),0,0],bob:{amplitude:[0,.06*n,0],speed:.6+.3*p(),phase:6.3*p()},pickable:!1}))}if(!w||!(r.foreground??!0))return m;for(let e=0;e<150;e++){const e=-(4.4+16*Math.pow(p(),1.6)),t=(2*p()-1)*(.52*-e+.8),o=.9+.9*p();g(tuftMesh(),[t,0,e],o,d([1,1,1,1]),u(6.3*p()))}for(let e=0;e<55;e++){const e=-(4.6+14*Math.pow(p(),1.4)),t=(2*p()-1)*(.5*-e+.6),o=FLOWER_COLORS[Math.floor(p()*FLOWER_COLORS.length)];g(flowerMesh(),[t,0,e],.9+.6*p(),d(o),u(6.3*p()))}return m}export const backgroundFor=e=>night(e)?SKY_NIGHT.horizon:SKY_DAY.horizon;export function*warmAssets(e,t=["meadow","desert"]){yield()=>skyMesh(e);for(const e of t)for(let t=0;t<HILLS[e].length;t++)yield()=>hillMesh(t,e);for(const e of[groundMesh,oakMesh,pineMesh,bushMesh,rockMesh,tuftMesh,flowerMesh])yield e;for(let e=0;e<HOT_AIR_PATTERNS.length;e++)yield()=>hotAirBalloonMesh(e)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{ProceduralCache}from"@nayan-ui/engine";import{PROCEDURAL_CACHE_VERSION}from"./ProceduralCacheVersion.js";let cache;export function cacheGameAsset(e,a){return cache??=new ProceduralCache(PROCEDURAL_CACHE_VERSION),cache.get(e,a)}export const flushProceduralCache=async()=>{await(cache?.flush())};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{createShape}from"@nayan-ui/engine";export function createGameMesh(e,t={}){return createShape(e,{...t,optimize:t.optimize??!0})}export{cacheGameAsset}from"./EngineMeshCache.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const createChase=()=>({eye:[6,3,6],target:[0,.2,0],initialized:!1});export function updateChase(e,t,a,i,r,n){const g=e.initialized?1-Math.exp(7*-Math.max(0,n)):1;for(let n=0;n<3;n++)e.eye[n]=e.eye[n]+(i[n]-e.eye[n])*g,e.target[n]=e.target[n]+(r[n]-e.target[n])*g,t.eye[n]=a[n]+e.eye[n],t.target[n]=a[n]+e.target[n];e.initialized=!0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export function stepSteering(t,a,e,n=9,r=10.5,l=!0){if(e<=0)return;if(!l){const a=t.lateral*Math.exp(2*-r*e);return t.d+=(t.lateral-a)/(2*r),t.lateral=a,void(t.steeringGoal=t.d)}let o=t.steeringGoal??t.d,h=e;for(;h>1e-9;){const e=Math.min(h,1/240);o=a+(o-a)*Math.exp(-22*e);const l=t.d-o,i=t.lateral+r*l,M=Math.exp(-r*e);let s=o+(l+i*e)*M,x=(t.lateral-r*i*e)*M;Math.abs(x)>n&&(x=Math.sign(x)*n,s=t.d+.5*(t.lateral+x)*e),t.d=s,t.lateral=x,h-=e}t.steeringGoal=o}export function sideImpactSpeed(t,a,e){return Math.max(0,(t-a)*(Math.sign(e)||1))}export function smoothSteeringPose(t,a,e,n){const r=1-Math.exp(18*-Math.max(0,n)),l=Math.max(-.22,Math.min(.22,.55*Math.atan2(a,Math.max(8,e)))),o=Math.max(-.035,Math.min(.035,.004*a)),h=(l-t.yaw)*r;t.yaw+=Math.max(-.9*n,Math.min(.9*n,h)),t.roll+=(o-t.roll)*r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{createContext}from"react";export const EngineReadyContext=createContext(!1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const EYE_DISTANCE=240;export function project(t,i,e,n=0){return[t.width/2+i,t.centerY-(e*Math.cos(t.tilt)+n*Math.sin(t.tilt))]}export function unproject(t,i,e,n=0){return[i-t.width/2,(t.centerY-e-n*Math.sin(t.tilt))/Math.cos(t.tilt)]}export function aimTilted(t,i){const e=i.centerY-i.height/2,n=[0,Math.cos(i.tilt),Math.sin(i.tilt)],o=[0,-Math.sin(i.tilt),Math.cos(i.tilt)];t.target=[0,n[1]*e,n[2]*e],t.eye=[0,t.target[1]+240*o[1],t.target[2]+240*o[2]],t.ortho=i.height/2}export function placeTiltedBackdrop(t,i,e,n){const o=e.centerY-e.height/2,h=Math.cos(e.tilt);t.set(i,{position:[-e.width/2,(e.height/2+o+n*Math.sin(e.tilt))/h,-n],scale:[1,1/h,1]})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{c as _0x5d5708}from"react/compiler-runtime";import{memo,useCallback,useEffect,useRef}from"react";import{Platform,StyleSheet,View}from"react-native";import{jsx as _0x2dd5e6}from"react/jsx-runtime";export const EngineTouchSurface=memo(function(e){const t=_0x5d5708(32),{enabled:n,insets:o,onStart:r,onMove:i,onEnd:a,onCancel:s}=e;let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,t[0]=u):u=t[0];const m=useRef(u);let l;t[1]!==s?(l=()=>{m.current.clear(),s()},t[1]=s,t[2]=l):l=t[2];const d=l;let f,p,v,h,S,b;t[3]!==d||t[4]!==n?(f=()=>{!n&&d()},p=[n,d],t[3]=d,t[4]=n,t[5]=f,t[6]=p):(f=t[5],p=t[6]),useEffect(f,p),t[7]!==d?(v=()=>()=>d(),h=[d],t[7]=d,t[8]=v,t[9]=h):(v=t[8],h=t[9]),useEffect(v,h),t[10]!==d?(S=()=>{if("web"!==Platform.OS)return;const e=()=>{document.hidden&&d()};return window.addEventListener("blur",d),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("blur",d),document.removeEventListener("visibilitychange",e)}},b=[d],t[10]=d,t[11]=S,t[12]=b):(S=t[11],b=t[12]),useEffect(S,b);const g=_temp;let E;t[13]!==n||t[14]!==a||t[15]!==i||t[16]!==r?(E=(e,t)=>{if(!n&&"end"!==t)return;const o="move"===t?e.nativeEvent.touches:e.nativeEvent.changedTouches;for(const n of o){const o={identifier:n.identifier,pageX:n.pageX,pageY:n.pageY,timeStamp:e.timeStamp};"start"===t?r(o):"move"===t?i(o):a(o)}},t[13]=n,t[14]=a,t[15]=i,t[16]=r,t[17]=E):E=t[17];const w=E,P=n?"auto":"none";let _,y,T,x;return t[18]===Symbol.for("react.memo_cache_sentinel")?(_="web"===Platform.OS?{touchAction:"none"}:null,t[18]=_):_=t[18],t[19]!==o?(y=[styles.surface,o,_],t[19]=o,t[20]=y):y=t[20],t[21]!==d||t[22]!==n||t[23]!==w||t[24]!==a||t[25]!==i||t[26]!==r?(T="web"===Platform.OS?{onPointerDown:e=>{const t=e;n&&0===t.button&&(!1!==t.isTrusted&&t.currentTarget.setPointerCapture(t.pointerId),m.current.add(t.pointerId),r(g(t)))},onPointerMove:e=>{n&&i(g(e))},onPointerUp:e=>{const t=e;m.current.delete(t.pointerId),a(g(t))},onPointerCancel:d,onLostPointerCapture:e=>{m.current.has(e.pointerId)&&d()}}:{onTouchStart:e=>w(e,"start"),onTouchMove:e=>w(e,"move"),onTouchEnd:e=>w(e,"end"),onTouchCancel:d},t[21]=d,t[22]=n,t[23]=w,t[24]=a,t[25]=i,t[26]=r,t[27]=T):T=t[27],t[28]!==P||t[29]!==y||t[30]!==T?(x=_0x2dd5e6(View,{collapsable:!1,pointerEvents:P,style:y,...T}),t[28]=P,t[29]=y,t[30]=T,t[31]=x):x=t[31],x});const styles=StyleSheet.create({surface:{position:"absolute",top:0,right:0,bottom:0,left:0}});function _temp(e){return{identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,timeStamp:e.timeStamp}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const HEX=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i,RGBA=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i;export function toColor(t,o=1){const r=HEX.exec(t);if(r){const t=parseInt(r[1],16);return[(t>>16&255)/255,(t>>8&255)/255,(255&t)/255,(r[2]?parseInt(r[2],16)/255:1)*o]}const n=RGBA.exec(t);return n?[Number(n[1])/255,Number(n[2])/255,Number(n[3])/255,(void 0===n[4]?1:Number(n[4]))*o]:[0,0,0,0]}export function toRgb(t){const[o,r,n]=toColor(t);return[o,r,n]}export function frontLight(t,o){const[r,n,e]=t,i=1/(.8*o+(1-o)*(e/Math.hypot(r,n,e)));return{direction:t,ambient:o,shadows:!1,color:[i,i,i]}}export{MAX_GAME_WIDTH,gameWidthFor}from"./EngineGameWidth";const INTRO_REPLAY_TIME=.5;export function introPlayed(t,o){t.intro&&t.introAge>=0&&(t.introAge+=o)>=.5&&(t.intro=!1)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{c as _0x565801}from"react/compiler-runtime";import{createContext,useContext,useLayoutEffect}from"react";export const GamePlayingContext=createContext(void 0);export function useGamePlaying(t){const e=_0x565801(4),o=useContext(GamePlayingContext);let n,a;e[0]!==o||e[1]!==t?(n=()=>(o?.(t),()=>o?.(!1)),a=[o,t],e[0]=o,e[1]=t,e[2]=n,e[3]=a):(n=e[2],a=e[3]),useLayoutEffect(n,a)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{c as _0x479791}from"react/compiler-runtime";import{memo,useCallback,useEffect,useRef,useState}from"react";import{AccessibilityInfo,ActivityIndicator,Pressable,StyleSheet,Text,View}from"react-native";import{GameView,isEngineAvailable,warmUpEngine}from"@nayan-ui/engine";import{GAMES_METADATA}from"../../services/GamesMetadata.js";import{resolveGameTheme}from"../../services/ThemeService.js";import{loadHudFonts}from"./EngineHud.js";import{EngineLoading,LOADING_LIGHT,loadingLook,loadingPlacement}from"./EngineLoading.js";import{useGameResource}from"./useGameResource.js";import{jsx as _0x32574c,Fragment as _0x2860de,jsxs as _0x44370d}from"react/jsx-runtime";const LoadingView=memo(function({gameId:e,theme:t,font:o,width:i,height:s,offset:r=0,label:l="Getting ready",error:n=!1,message:a,onRetry:d,visible:m=!0,reducedMotion:u,onFailure:g}){const h=useGameResource(()=>new EngineLoading(e,t,o),e=>()=>e.dispose());useEffect(()=>h.layout(i,s,r),[h,i,s,r]),useEffect(()=>h.setStatus({label:l,error:n,message:a,retry:!!d,reducedMotion:u}),[h,l,n,a,d,u]);const y=useCallback(e=>h.update(e),[h]),f=useRef(d);f.current=d;const b=useCallback((e,t)=>{const o=h.retryBounds;n&&e>=o.left&&e<=o.left+o.width&&t>=o.top&&t<=o.top+o.height&&f.current?.()},[h,n]),{retryBounds:p}=loadingPlacement(i,s,r);return _0x44370d(_0x2860de,{children:[_0x32574c(GameView,{source:h.world,camera:h.camera,light:LOADING_LIGHT,background:h.clearColor,onUpdate:y,paused:!m,onTap:b,onError:g,style:StyleSheet.absoluteFill}),m&&n&&d&&_0x32574c(Pressable,{accessibilityRole:"button",accessibilityLabel:"Try again",onPress:d,style:{position:"absolute",...p}})]})});export const GameLoading=memo(function(e){const t=_0x479791(43),{gameId:o,theme:i,label:s,error:r,message:l,onRetry:n,offset:a,visible:d}=e,m=void 0===s?"Getting ready":s,u=void 0!==r&&r,g=void 0===a?0:a,h=void 0===d||d;let y;t[0]!==i?(y=resolveGameTheme(i),t[0]=i,t[1]=y):y=t[1];const f=y;let b;t[2]!==o||t[3]!==i?(b=loadingLook(o,i),t[2]=o,t[3]=i,t[4]=b):b=t[4];const p=b,_=GAMES_METADATA[o].title,[x,w]=useState(null),[S,T]=useState(null),[E,v]=useState(!1),[L,A]=useState(!0);let G,I,R,k,C;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{let e=!0;AccessibilityInfo.isReduceMotionEnabled().then(t=>{e&&A(t)},_temp);const t=AccessibilityInfo.addEventListener("reduceMotionChanged",A);return()=>{e=!1,t.remove()}},I=[],t[5]=G,t[6]=I):(G=t[5],I=t[6]),useEffect(G,I),t[7]!==E||t[8]!==S||t[9]!==h?(k=()=>{if(S||!h||!isEngineAvailable||E)return;let e=!0;return warmUpEngine().then(loadHudFonts).then(t=>{e&&T(t.semi)},()=>{e&&v(!0)}),()=>{e=!1}},R=[S,h,E],t[7]=E,t[8]=S,t[9]=h,t[10]=R,t[11]=k):(R=t[10],k=t[11]),useEffect(k,R),t[12]===Symbol.for("react.memo_cache_sentinel")?(C=e=>{const{width:t,height:o}=e.nativeEvent.layout;w(e=>e?.width===t&&e.height===o?e:{width:t,height:o})},t[12]=C):C=t[12];const V=C;let M;t[13]===Symbol.for("react.memo_cache_sentinel")?(M=()=>v(!0),t[13]=M):M=t[13];const j=M,D=!!S&&!!x&&x.width>0&&x.height>0&&!E;let P;t[14]!==p.colours.sky?(P=[styles.root,{backgroundColor:p.colours.sky}],t[14]=p.colours.sky,t[15]=P):P=t[15];const z=!u,F=u?"alert":"progressbar",H=!u;let U;t[16]!==H?(U={busy:H},t[16]=H,t[17]=U):U=t[17];const O=_+". "+(u?l??"Unable to prepare this game":m);let B,N;return t[18]!==f||t[19]!==u||t[20]!==S||t[21]!==o||t[22]!==m||t[23]!==p.colours.accent||t[24]!==p.colours.horizon||t[25]!==p.colours.second||t[26]!==l||t[27]!==g||t[28]!==n||t[29]!==D||t[30]!==L||t[31]!==x||t[32]!==i||t[33]!==_||t[34]!==h?(B=D?_0x32574c(LoadingView,{gameId:o,theme:i,font:S,width:x.width,height:x.height,label:m,error:u,message:l,onRetry:n,offset:g,visible:h,reducedMotion:L,onFailure:j},o+":"+i):h&&_0x44370d(View,{style:[styles.fallback,{paddingTop:g}],children:[_0x44370d(View,{testID:"game-loading-art",accessible:!1,style:styles.art,children:[_0x32574c(View,{style:[styles.tile,{backgroundColor:p.colours.second,left:8,top:26,transform:[{rotate:"-16deg"}]}]}),_0x32574c(View,{style:[styles.tile,{backgroundColor:p.colours.horizon,right:8,top:26,transform:[{rotate:"16deg"}]}]}),_0x32574c(View,{style:[styles.tile,{backgroundColor:p.colours.accent,left:45,top:8}]})]}),_0x32574c(Text,{style:[styles.title,{color:f.TEXT}],children:_}),!u&&_0x32574c(ActivityIndicator,{animating:!L,hidesWhenStopped:!1,color:p.colours.accent,style:styles.spinner}),_0x32574c(Text,{accessibilityLiveRegion:"polite",accessibilityRole:u?"alert":"progressbar",style:[styles.label,{color:f.TEXT_SUBTLE}],children:u?l??"Unable to prepare this game.":m+"\u2026"}),u&&n&&_0x32574c(Pressable,{accessibilityRole:"button",onPress:n,style:[styles.retry,{backgroundColor:f.SOLID}],children:_0x32574c(Text,{style:{color:f.ON_SOLID},children:"Try again"})})]}),t[18]=f,t[19]=u,t[20]=S,t[21]=o,t[22]=m,t[23]=p.colours.accent,t[24]=p.colours.horizon,t[25]=p.colours.second,t[26]=l,t[27]=g,t[28]=n,t[29]=D,t[30]=L,t[31]=x,t[32]=i,t[33]=_,t[34]=h,t[35]=B):B=t[35],t[36]!==P||t[37]!==z||t[38]!==F||t[39]!==U||t[40]!==O||t[41]!==B?(N=_0x32574c(View,{testID:"game-loading",style:P,onLayout:V,accessible:z,accessibilityLiveRegion:"polite",accessibilityRole:F,accessibilityState:U,accessibilityLabel:O,children:B}),t[36]=P,t[37]=z,t[38]=F,t[39]=U,t[40]=O,t[41]=B,t[42]=N):N=t[42],N});const styles=StyleSheet.create({root:{flex:1},fallback:{flex:1,justifyContent:"center",alignItems:"center",padding:24},art:{width:144,height:104,marginBottom:24},tile:{position:"absolute",width:54,height:54,borderRadius:14,borderWidth:2,borderColor:"#ffffff55"},spinner:{marginTop:20},title:{fontSize:24,fontWeight:"600",textAlign:"center"},label:{fontSize:16,marginTop:12,textAlign:"center"},retry:{marginTop:20,paddingHorizontal:20,paddingVertical:12,borderRadius:12}});function _temp(){}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{memo,useEffect,useRef,useState}from"react";import{AccessibilityInfo,Animated,Platform,StyleSheet,View}from"react-native";import{jsx as _0xaad5c9,jsxs as _0x348c1a}from"react/jsx-runtime";export const GameLoadingTransition=memo(function({ready:e,loader:t,children:i}){const[a,n]=useState(!e),r=useRef(new Animated.Value(1)).current;return useEffect(()=>{if(!e)return r.setValue(1),void n(!0);if(!a)return;let t,i=!0,s=0;return AccessibilityInfo.isReduceMotionEnabled().catch(()=>!1).then(e=>{i&&(s=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>{i&&(t=Animated.timing(r,{toValue:0,duration:e?0:160,useNativeDriver:"web"!==Platform.OS}),t.start(({finished:e})=>{i&&e&&n(!1)}))})}))}),()=>{i=!1,cancelAnimationFrame(s),t?.stop()}},[e,a,r]),_0x348c1a(View,{style:styles.root,children:[e&&i,(a||!e)&&_0xaad5c9(Animated.View,{pointerEvents:e?"none":"auto",accessibilityElementsHidden:e,importantForAccessibility:e?"no-hide-descendants":"auto",style:[StyleSheet.absoluteFill,{opacity:e?r:1}],children:t})]})});const styles=StyleSheet.create({root:{flex:1}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const PROCEDURAL_CACHE_VERSION="6db8360ff38ef1524ff6b80f67938974";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{useEffect,useLayoutEffect,useRef}from"react";import{playHaptic}from"../../services/HapticsService.js";import{playSound,preloadGameSounds,preloadSounds,stopAllSounds}from"../../services/SoundsService.js";import{resolveGameTheme}from"../../services/ThemeService.js";import{useGameResource}from"./useGameResource.js";import{useLiveState}from"./useLiveState.js";export function useEngineGame(e,r){const{settings:o}=e,t=resolveGameTheme(o.theme),[n,s]=useLiveState("ready",0),[a,p]=useLiveState("lose",0),[u,i]=useLiveState(!1,0),d=useRef({props:e,spec:r});d.current={props:e,spec:r};const l=useGameResource(()=>{const e=r.create(t);let o=!1,n=!1;const a=(e,r)=>{if(n||d.current.props.settings.isVisible)return;const{enableSounds:o,enableHaptics:t}=d.current.props.settings;e&&playSound(e,o),null!=r&&playHaptic(r,t)},u=r=>{if(o)return;o=!0;const t=d.current.spec.reportScore?.(e,r)??e.score??0,n=d.current.spec.reportData?.(e,r);d.current.props.onEndGame?.({status:r,score:t.toString(),...n?{additionalData:n}:{}})};e.onPhase=r=>{if("over"===r){const r=d.current.spec.outcome?.(e)??(e.won?"win":"lose");p(r),u("draw"===r?"cancel":r),d.current.spec.onOver?.(a,r,e)}s(r)};const i=()=>d.current.spec,l={onActiveChange:r=>i().setActive?.(e,r),onUpdate:(r,o)=>{i().tick?.(e,r),o&&i().hud?.(e,o)},onResize:(r,o,t)=>i().resize?.(e,r,o,t),onDrag:r=>i().drag?.(e,r),onTap:(r,o)=>i().tap?.(e,r,o),onStart:()=>{stopAllSounds(),o=!1,i().start(e),i().onStart?.(a)},onStop:()=>{stopAllSounds(),u("cancel"),i().onStop?.(a),i().reset(e)},playAgain:()=>{stopAllSounds(),o=!1,d.current.props.onReplayGame?.(),(i().replay??i().reset)(e),i().onPlayAgain?.(a)}};return{game:e,fx:a,report:u,handlers:l,closeFeedback:()=>{n=!0,stopAllSounds()}}},e=>{const{game:o,fx:t}=e;preloadGameSounds(r.gameId),r.sounds&&preloadSounds(r.sounds);const n=r.wire?.(o,t);return()=>{e.closeFeedback(),n?.(),"playing"===o.phase&&e.report("cancel"),d.current.spec.dispose(o)}}),{game:S,fx:m,handlers:g}=l,f=useRef(t);useLayoutEffect(()=>{f.current!==t&&(f.current=t,d.current.spec.setTheme?.(S,t))},[S,t]),useEffect(()=>{if("over"!==n)return i(!1);const e=d.current.spec.resultsDelay?.(a)??0;if(!e)return i(!0);const r=setTimeout(()=>i(!0),e);return()=>clearTimeout(r)},[n,a,i]);const h={gameId:r.gameId,feedback:S.hudFeedback,onActiveChange:g.onActiveChange,settings:o,onSettingsChange:e.onSettingsChange,onShare:e.onShareScreenshot??e.onShare,onShowLeaderboard:e.onShowLeaderboard,bannerAd:e.bannerAd,source:S.world,camera:S.camera,onUpdate:g.onUpdate,onResize:r.resize?g.onResize:void 0,onDrag:r.drag?g.onDrag:void 0,onTap:r.tap?g.onTap:void 0,playing:"playing"===n,onStart:g.onStart,onStop:g.onStop};return{game:S,theme:t,phase:n,status:a,fx:m,screen:h,gameOver:r=>u?{...r,onPlayAgain:g.playAgain,onShare:e.onShareScreenshot}:null}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{useEffect,useRef}from"react";export function useGameResource(e,u){const s=useRef(null);s.current??={value:e(),users:0};const r=s.current;return useEffect(()=>(r.users++,r.cleanup??=u(r.value),()=>{r.users--,queueMicrotask(()=>{0===r.users&&(r.cleanup?.(),r.cleanup=void 0)})}),[r]),r.value}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{useRef,useSyncExternalStore}from"react";const MIN_INTERVAL=100;function createStore(e,t){let r=e,n=e,u=-1/0,o=null;const s=new Set,i=()=>{if(o=null,u=Date.now(),!Object.is(r,n)){r=n;for(const e of s)e()}};return{get:()=>r,subscribe:e=>(s.add(e),()=>{s.delete(e),!s.size&&o&&(clearTimeout(o),o=null)}),set:e=>{if(n="function"==typeof e?e(n):e,o)return;const r=t-(Date.now()-u);r<=0?i():o=setTimeout(i,r)}}}export function useLiveState(e,t=100){const r=useRef(null);return r.current||(r.current=createStore("function"==typeof e?e():e,t)),[useSyncExternalStore(r.current.subscribe,r.current.get),r.current.set]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{HapticType}from"../../services/HapticsService.js";import{GAME_SOUNDS}from"../../services/SoundsService.js";import{GAME_IDS,isTablet}from"../../services/UtilsService.js";import{engineGame,EngineGameScreen}from"../shared/EngineGameScreen.js";import{timerColumn}from"../shared/EngineHud.js";import{useEngineGame}from"../shared/useEngineGame.js";import{useLiveState}from"../shared/useLiveState.js";import{GAME_DURATION,getLayout,LIGHT}from"./SlidingNumbersConstants.js";import{createGame,dispose,drag,newBoard,setLayout,setTheme,start,stop,tick}from"./SlidingNumbersGame.js";import{jsx as _0x4441e2}from"react/jsx-runtime";const SOUNDS=GAME_SOUNDS.SLIDING_NUMBERS;export const SlidingNumbers=engineGame(GAME_IDS.SLIDING_NUMBERS,e=>{const[t,s]=useLiveState(GAME_DURATION),{game:r,theme:i,status:o,screen:a,gameOver:m}=useEngineGame(e,{gameId:GAME_IDS.SLIDING_NUMBERS,create:createGame,start:start,reset:stop,replay:newBoard,dispose:dispose,tick:tick,setTheme:setTheme,resize:(e,t,s,r)=>{const i=getLayout(t,s,r,isTablet);return setLayout(e,i),i.size+2*i.pad},drag:drag,sounds:SOUNDS,onStart:e=>e(SOUNDS.START),wire:(e,t)=>{e.onTime=s,e.onEvent=e=>{"blocked"===e?t(SOUNDS.BLOCKED,HapticType.WARNING):"move"===e?t(SOUNDS.MOVE,HapticType.LIGHT):"win"===e?t(SOUNDS.WIN):"lose"===e&&t(SOUNDS.GAME_OVER)}}});return _0x4441e2(EngineGameScreen,{...a,light:LIGHT,columns:[timerColumn(t,i)],subtext:"Slide tiles to solve!",gameOver:m({title:"win"===o?"SOLVED!":"TIME UP!",message:"win"===o?"Puzzle completed!":"You ran out of time!",scoreLabel:"Score",score:r.score,buttonText:"win"===o?"Play Again!":"Try Again!"})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{getScoreBoardTop}from"../shared/EngineHud.js";import{frontLight,gameWidthFor}from"../shared/EngineUtils.js";export const GAME_DURATION=300;export const SLIDE_TIME=.2;export const PRESS_SCALE=.92;export const TAP_SLOP=10;export const SWIPE=18;export const TILE_COLORS=["#FF6B6B","#51CF66","#339AF0","#FCC419","#CC5DE8","#FF922B","#22B8CF","#F06595"];export const NUMBER_WORDS=["","ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT"];export const COLORS={FRAME:"#5c4033",WELL:"#3a2518",SLOT:"#2e1d12",NUMBER:"#FFFFFF"};export const TILT=0;export const LIGHT=frontLight([0,0,1],.6);export const TILE_HEIGHT=.4;const SCOREBOARD_HEIGHT=82,CONTROLS_HEIGHT=120;export function getLayout(t,o,e,r){const n=r?6:4,s=r?18:14,E=getScoreBoardTop(e)+82,i=Math.max(180,o-E-120),p=Math.max(150,Math.min(gameWidthFor(t),i/Math.cos(0)-30)),h=Math.floor((p-2*s-2*n)/3);return{width:t,height:o,tilt:0,centerY:E+i/2,tile:h,gap:n,pitch:h+n,pad:s,size:3*h+2*n}}export const cellCentre=(t,o,e)=>[(e-1)*t.pitch,(1-o)*t.pitch];export function cellAt(t,o,e){const r=Math.floor((o+t.size/2)/t.pitch),n=Math.floor((t.size/2-e)/t.pitch);return n<0||n>2||r<0||r>2?null:[n,r]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{World}from"@nayan-ui/engine";import{calculateTimeBasedScore}from"../../services/ScoringService.js";import{aimTilted,unproject}from"../shared/EngineTilt.js";import{cellAt,GAME_DURATION,SWIPE,TAP_SLOP,TILE_HEIGHT}from"./SlidingNumbersConstants.js";import{canSlide,shuffled,slide,solved,tileAt}from"./SlidingNumbersRules.js";import{buildScene,celebrate,dim,placeTile,press,removeScene,setSceneTheme,shake,undim}from"./SlidingNumbersScene.js";const WORLD_CAPACITY=400;export function createGame(e){const o=new World(400),r={world:o,camera:{eye:[0,0,240],target:[0,0,0],fov:1,ortho:1},theme:e,layout:null,scene:null,phase:"ready",board:shuffled(),won:!1,get score(){return o.scoreboard.score},get timeLeft(){return o.scoreboard.shownSeconds},press:null,onPhase:e=>{},onTime:e=>{},onEvent:e=>{}};return o.scoreboard.reset(0,GAME_DURATION),o.scoreboard.handlers={onSecond:e=>r.onTime(e),onTimeUp:()=>"playing"===r.phase&&end(r,!1)},r}export function setLayout(e,o){e.scene&&removeScene(e.world,e.scene),e.layout=o,aimTilted(e.camera,o),e.scene=buildScene(e.world,o,e.theme,e.board.tiles)}export function setTheme(e,o){e.theme=o,e.layout&&e.scene&&setSceneTheme(e.world,e.layout,e.scene,o)}export function start(e){"ready"===e.phase&&(e.won=!1,e.world.scoreboard.reset(),e.world.scoreboard.startCountdown(GAME_DURATION),e.phase="playing",e.onTime(GAME_DURATION),e.onPhase("playing"))}export function stop(e){e.press=null,e.won=!1,e.world.scoreboard.reset(0,GAME_DURATION),e.phase="ready",e.scene&&undim(e.world,e.scene,e.board.tiles),e.onTime(GAME_DURATION),e.onPhase("ready")}export function newBoard(e){e.board=shuffled();const{layout:o,scene:r}=e;if(o&&r){undim(e.world,r,e.board.tiles);for(const n of e.board.tiles)placeTile(e.world,o,r,n)}stop(e)}export function dispose(e){e.world.dispose()}export function tick(e,o){e.world.isDisposed||e.world.update(o)}function end(e,o){e.world.scoreboard.stop(),e.won=o,o||e.world.scoreboard.set(0),e.phase="over",e.press&&e.layout&&e.scene&&press(e.world,e.scene,e.press.id,!1),e.press=null,e.layout&&e.scene&&(o?celebrate(e.world,e.layout,e.scene,e.board.tiles):dim(e.world,e.scene,e.board.tiles)),e.onPhase("over"),e.onEvent(o?"win":"lose")}export function move(e,o){if("playing"!==e.phase||0===o.value)return;const{layout:r,scene:n}=e;if(!canSlide(e.board,o))return r&&n&&shake(e.world,r,n,o.id),void e.onEvent("blocked");slide(e.board,o),r&&n&&placeTile(e.world,r,n,o),e.onEvent("move"),solved(e.board)&&(e.world.scoreboard.set(calculateTimeBasedScore(GAME_DURATION-e.timeLeft,GAME_DURATION,0)),end(e,!0))}export function tileUnder(e,o,r){const n=e.layout;if(!n)return null;const[s,t]=unproject(n,o,r,1+n.tile*TILE_HEIGHT),l=cellAt(n,s,t),d=l?tileAt(e.board,l[0],l[1]):null;return d&&0!==d.value?d:null}export function drag(e,{phase:o,x:r,y:n}){const{layout:s,scene:t}=e;if("start"===o){const o="playing"===e.phase?tileUnder(e,r,n):null;return e.press=o?{x:r,y:n,id:o.id}:null,void(o&&s&&t&&press(e.world,t,o.id,!0))}const l=e.press;if(!l)return;const d=e.board.tiles.find(e=>e.id===l.id),i=r-l.x,a=n-l.y,u=Math.hypot(i,a);if(u>=SWIPE||"end"===o){if(e.press=null,s&&t&&press(e.world,t,l.id,!1),u<TAP_SLOP)return move(e,d);if(u<SWIPE)return;const o=Math.abs(i)>Math.abs(a),r=d.row+(o?0:a>0?1:-1),n=d.col+(o?i>0?1:-1:0);r===e.board.emptyRow&&n===e.board.emptyCol?move(e,d):(s&&t&&shake(e.world,s,t,d.id),e.onEvent("blocked"))}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const GRID=3;const CELLS=9,DIRS=[[-1,0],[1,0],[0,-1],[0,1]],NEIGHBORS=Array.from({length:9},(o,t)=>{const l=Math.floor(t/3),e=t%3;return DIRS.filter(([o,t])=>l+o>=0&&l+o<3&&e+t>=0&&e+t<3).map(([o,t])=>3*(l+o)+e+t)});export function shuffled(){const o=Array.from({length:9},(o,t)=>({id:t,value:8===t?0:t+1,row:Math.floor(t/3),col:t%3}));let t=2,l=2;const e=o.slice(),r=o[8];for(let o=0;o<200;o++){const o=3*t+l,n=NEIGHBORS[o],a=n[Math.floor(Math.random()*n.length)],s=Math.floor(a/3),f=a%3,i=e[a];e[o]=i,e[a]=r,r.row=s,r.col=f,i.row=t,i.col=l,t=s,l=f}return{tiles:o,emptyRow:t,emptyCol:l}}export const tileAt=(o,t,l)=>o.tiles.find(o=>o.row===t&&o.col===l)??null;export function canSlide(o,t){return 0!==t.value&&Math.abs(t.row-o.emptyRow)+Math.abs(t.col-o.emptyCol)===1}export function slide(o,t){const l=o.tiles.find(o=>0===o.value),[e,r]=[t.row,t.col];t.row=o.emptyRow,t.col=o.emptyCol,l.row=e,l.col=r,o.emptyRow=e,o.emptyCol=r}export const solved=o=>o.tiles.every(o=>0===o.value?2===o.row&&2===o.col:o.row===Math.floor((o.value-1)/3)&&o.col===(o.value-1)%3);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{effects,extrude,Path}from"@nayan-ui/engine";import{setBackdropTheme,spawnBackdrop}from"../shared/EngineBackdrop.js";import{spawnRaisedBlock}from"../shared/EngineBlocks.js";import{flatGlyphMesh,GLYPH_ADVANCE}from"../shared/EngineGlyphs.js";import{cacheGameAsset,createGameMesh as _0x55ceb7}from"../shared/EngineMeshes.js";import{placeTiltedBackdrop}from"../shared/EngineTilt.js";import{toColor}from"../shared/EngineUtils.js";import{cellCentre,COLORS,NUMBER_WORDS,PRESS_SCALE,SLIDE_TIME,TILE_COLORS,TILE_HEIGHT}from"./SlidingNumbersConstants.js";const meshes=new Map,cached=(e,o)=>{let t=meshes.get(e);return!t&&(t=cacheGameAsset("sliding-numbers/SlidingNumbersScene:"+e,o),meshes.set(e,t)),t},BOARD_DEPTH=12,BACKDROP_DEPTH=30,SURFACE=1,panelMesh=(e,o,t)=>cached("sn-panel:"+e+":"+o+":"+t,()=>_0x55ceb7(extrude((new Path).addRoundedRect(-e/2,-e/2,e,e,o),{depth:t}),{shine:.25})),tileTop=e=>1+e.tile*TILE_HEIGHT,at=(e,o,t)=>{const[s,n]=cellCentre(e,o,t);return[s,n,1]};function spawnBoard(e,o,t){const s=[],n=o=>s.push(e.spawn({pickable:!1,...o})),i=o.size+2*o.pad,a="classic"===t.mode;n({mesh:panelMesh(i,a?16:8,12),position:[0,0,-6],color:toColor(a?COLORS.FRAME:t.BOARD.SURFACE)}),a&&n({mesh:panelMesh(o.size+8,10,1),position:[0,0,.2],color:toColor(COLORS.WELL)});for(let e=0;e<3;e++)for(let s=0;s<3;s++){const[i,r]=cellCentre(o,e,s);n({mesh:panelMesh(o.tile,Math.min(10,.12*o.tile),1),position:[i,r,.5],color:toColor(a?COLORS.SLOT:t.BOARD.CELL_EMPTY)})}return s}function spawnLabel(e,o,t,s){const n=toColor(COLORS.NUMBER),[i,a,r]=toColor(TILE_COLORS[s-1]),l=[.45*i,.45*a,.45*r,1],p=tileTop(o)-1,d=(o,s,i,a)=>{const r=Math.max(1,.05*a);e.spawn({mesh:flatGlyphMesh(o),parent:t,position:[s+r,i-r,p+.3],scale:a,color:l,pickable:!1}),e.spawn({mesh:flatGlyphMesh(o),parent:t,position:[s,i,p+.6],scale:a,color:n,pickable:!1})};d(String(s),0,.07*o.tile,.32*o.tile);const h=NUMBER_WORDS[s],m=.11*o.tile,f=m*GLYPH_ADVANCE;[...h].forEach((e,t)=>d(e,(t-(h.length-1)/2)*f,.24*-o.tile,m))}export function buildScene(e,o,t,s){const n=spawnBackdrop(e,o.width,o.height,-30,t);placeTiltedBackdrop(e,n,o,30);const i={backdrop:n,board:spawnBoard(e,o,t),tiles:new Map},a=o.tile*TILE_HEIGHT;for(const t of s){if(0===t.value)continue;const s=e.spawn({mesh:"none",position:at(o,t.row,t.col),pickable:!1}),n=spawnRaisedBlock(e,{parent:s,position:[0,0,a/2],size:[o.tile,o.tile,a],color:toColor(TILE_COLORS[t.value-1]),gloss:!1,shadow:!1});spawnLabel(e,o,s,t.value),i.tiles.set(t.id,{root:s,block:n})}return i}export function removeScene(e,o){for(const t of[o.backdrop,...o.board,...Array.from(o.tiles.values(),e=>e.root)])e.despawn(t)}export function setSceneTheme(e,o,t,s){setBackdropTheme(e,t.backdrop,s);for(const o of t.board)e.despawn(o);t.board=spawnBoard(e,o,s)}export function placeTile(e,o,t,s,n=!0){const i=t.tiles.get(s.id);i&&(n?e.animate(i.root,{position:at(o,s.row,s.col)},{duration:SLIDE_TIME,easing:"easeOut"}):(e.stopAnimation(i.root),e.set(i.root,{position:at(o,s.row,s.col)})))}export function press(e,o,t,s){const n=o.tiles.get(t);if(!n)return;const i=s?PRESS_SCALE:1;e.animate(n.root,{scale:i},{duration:s?.08:.14,easing:s?"easeOut":"back"})}export function shake(e,o,t,s){const n=t.tiles.get(s);n&&e.animate(n.root,{shake:.05*o.tile},{duration:.25})}export function celebrate(e,o,t,s){for(const n of s){const s=t.tiles.get(n.id);if(!s)continue;const[i,a,r]=at(o,n.row,n.col);e.animate(s.root,[{position:[i,a,r+.35*o.tile],scale:1.04,at:.4},{position:[i,a,r],scale:1}],{duration:.45,delay:SLIDE_TIME+.07*(n.row+n.col),easing:"easeOut"})}effects.confetti(e,{position:[0,0,o.tile],count:60,size:.08*o.tile,speed:1.4*o.size,lifetime:1.3,gravity:2.4*-o.size,colors:TILE_COLORS.slice(0,4).map(e=>toColor(e))})}export function dim(e,o,t){for(const s of t){const t=o.tiles.get(s.id);if(!t)continue;const n=toColor(TILE_COLORS[s.value-1]);e.animate(t.block,{color:[.5*n[0],.5*n[1],.55*n[2],1]},{duration:.4})}}export function undim(e,o,t){for(const s of t){const t=o.tiles.get(s.id);t&&e.set(t.block,{color:toColor(TILE_COLORS[s.value-1])})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{HapticType}from"../../services/HapticsService.js";import{GAME_SOUNDS}from"../../services/SoundsService.js";import{GAME_IDS}from"../../services/UtilsService.js";import{engineGame,EngineGameScreen}from"../shared/EngineGameScreen.js";import{scoreColumn,timerColumn}from"../shared/EngineHud.js";import{useEngineGame}from"../shared/useEngineGame.js";import{useLiveState}from"../shared/useLiveState.js";import{getLayout,LIGHT,TIME_LIMIT}from"./Snake3DConstants.js";import{createGame,dispose,drag,reset,setLayout,setTheme,start,tick}from"./Snake3DGame.js";import{jsx as _0x490596}from"react/jsx-runtime";const SOUNDS=GAME_SOUNDS.SNAKE_3D,FEEDBACK={eat:{sound:SOUNDS.EAT,haptic:HapticType.MEDIUM},special:{sound:SOUNDS.SPECIAL,haptic:HapticType.HEAVY},crash:{sound:SOUNDS.COLLISION,haptic:HapticType.HEAVY}},scoreText=e=>""+e;export const Snake3D=engineGame(GAME_IDS.SNAKE_3D,e=>{const[t,s]=useLiveState(0),[r,o]=useLiveState(TIME_LIMIT),{theme:a,screen:i,gameOver:n}=useEngineGame(e,{gameId:GAME_IDS.SNAKE_3D,create:createGame,start:start,reset:reset,dispose:dispose,tick:tick,setTheme:setTheme,resize:(e,t,s,r)=>{const o=getLayout(t,s,r);return setLayout(e,o),o.size+o.cell},drag:drag,outcome:()=>"lose",sounds:SOUNDS,onStart:e=>e(SOUNDS.START),onStop:e=>e(null,HapticType.LIGHT),onOver:(e,t,s)=>e(s.timeLeft<=0?SOUNDS.TIME_UP:SOUNDS.GAME_OVER,HapticType.ERROR),wire:(e,t)=>{e.onScore=s,e.onTime=o,e.onEvent=e=>t(FEEDBACK[e].sound,FEEDBACK[e].haptic)}});return _0x490596(EngineGameScreen,{...i,light:LIGHT,columns:[scoreColumn(t),timerColumn(r,a,0)],subtext:"Swipe to steer!",gameOver:n({title:"GAME OVER",message:"You hit the wall or yourself!",scoreLabel:"Final Score",score:t,formatter:scoreText,buttonText:"Play Again!"})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import{getScoreBoardTop}from"../shared/EngineHud.js";import{frontLight,gameWidthFor}from"../shared/EngineUtils.js";import{GRID}from"./Snake3DRules.js";export const TIME_LIMIT=300;export const TICK_MS=300;export const MAX_FRAME_MS=100;export const SWIPE=15;export const COLORS={HEAD:"#00c853",BODY:"#00a344",TAIL:"#008035",BELLY:"#7CF2A8",EYE:"#FFFFFF",PUPIL:"#111111",TONGUE:"#E53935",SPECIAL:"#ffa502",CRASH:"#ff4757",CLASSIC_BOARD:"rgba(255, 255, 255, 0.30)",CLASSIC_DARK:"rgba(255, 255, 255, 0.10)",CLASSIC_RIM:"rgba(255, 255, 255, 0.55)"};export const TILT=0;export const LIGHT=frontLight([-.4,.5,1],.45);const SCOREBOARD_HEIGHT=82,CONTROLS_HEIGHT=120,RIM=.5;export function getLayout(t,o,e){const r=getScoreBoardTop(e)+82,n=Math.max(200,o-r-120),s=gameWidthFor(t)/(GRID+1),i=n/(Math.cos(0)*(GRID+1)+1.5*Math.sin(0)),I=Math.max(8,Math.min(s,i));return{width:t,height:o,tilt:0,centerY:r+n/2,cell:I,size:I*GRID}}export const gridPoint=(t,o,e)=>[o*t.cell-t.size/2,t.size/2-e*t.cell];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{World}from"@nayan-ui/engine";import{aimTilted}from"../shared/EngineTilt.js";import{MAX_FRAME_MS,SWIPE,TICK_MS,TIME_LIMIT}from"./Snake3DConstants.js";import{freshState,generateFood,POINTS_PER_FOOD,POINTS_PER_SPECIAL_FOOD,step,turn}from"./Snake3DRules.js";import{buildScene,crash,drawSnake,faceHead,flick,gulp,placeFood,removeScene,resetSnake,setSceneTheme}from"./Snake3DScene.js";const WORLD_CAPACITY=1e3;export function createGame(e){const o=new World(1e3),n=freshState(),r={world:o,camera:{eye:[0,0,240],target:[0,0,0],fov:1,ortho:1},theme:e,layout:null,scene:null,phase:"ready",st:n,prev:n.snake.slice(),pending:0,get score(){return o.scoreboard.score},get timeLeft(){return o.scoreboard.shownSeconds},clock:0,moves:0,anchor:null,onPhase:e=>{},onScore:e=>{},onTime:e=>{},onEvent:e=>{}};return o.scoreboard.reset(0,TIME_LIMIT),o.scoreboard.handlers={onScore:e=>r.onScore(e),onSecond:e=>r.onTime(e),onTimeUp:()=>"playing"===r.phase&&end(r)},r}export function setLayout(e,o){e.scene&&removeScene(e.world,e.scene),e.layout=o,aimTilted(e.camera,o),e.scene=buildScene(e.world,o,e.theme),faceHead(e.world,e.scene,e.st.direction),draw(e)}export function setTheme(e,o){e.theme=o,e.layout&&e.scene&&setSceneTheme(e.world,e.layout,e.scene,o)}function draw(e){const{layout:o,scene:n}=e;o&&n&&(drawSnake(e.world,o,n,e.prev,e.st.snake,"playing"===e.phase?e.pending/TICK_MS:1),placeFood(e.world,o,n,e.st.food))}function home(e){e.st=freshState(),e.prev=e.st.snake.slice(),e.pending=0,e.world.scoreboard.reset(0,TIME_LIMIT),e.layout&&e.scene&&(resetSnake(e.world,e.layout,e.scene),faceHead(e.world,e.scene,"RIGHT"))}export function start(e){"ready"===e.phase&&(home(e),e.st.food=generateFood(e.st.snake,!1,1,e.clock),e.st.nextFoodId=2,e.world.scoreboard.startCountdown(TIME_LIMIT),e.phase="playing",draw(e),e.onScore(0),e.onTime(TIME_LIMIT),e.onPhase("playing"))}export function reset(e){home(e),e.phase="ready",e.anchor=null,draw(e),e.onScore(0),e.onTime(TIME_LIMIT),e.onPhase("ready")}export function dispose(e){e.world.dispose()}export function tick(e,o){e.world.isDisposed||(e.clock+=Math.min(o,.25),"playing"===e.phase&&(e.pending+=Math.min(1e3*o,MAX_FRAME_MS),e.pending>=TICK_MS&&(e.pending-=TICK_MS,move(e)),draw(e)),e.world.update(o))}function move(e){const{layout:o,scene:n}=e,r=e.st.snake.slice(),a=step(e.st,e.clock);if(a.crash)return e.prev=e.st.snake.slice(),e.pending=0,o&&n&&(faceHead(e.world,n,e.st.direction),crash(e.world,o,n,e.camera)),e.onEvent("crash"),void end(e);e.prev=r,++e.moves%9==0&&n&&flick(e.world,n),a.ate&&(e.world.scoreboard.add(a.ate.isSpecial?POINTS_PER_SPECIAL_FOOD:POINTS_PER_FOOD),o&&n&&gulp(e.world,o,n,a.ate),e.onEvent(a.ate.isSpecial?"special":"eat"))}function end(e){e.world.scoreboard.stop(),e.phase="over",e.anchor=null,e.onPhase("over")}export function drag(e,{phase:o,x:n,y:r,cancelled:a}){if("start"===o)return void(e.anchor=[n,r]);const t=e.anchor;if("end"===o&&(e.anchor=null),"end"===o&&a)return;if(!t||"playing"!==e.phase)return;const s=n-t[0],d=r-t[1];Math.abs(s)<=SWIPE&&Math.abs(d)<=SWIPE||(turn(e.st,Math.abs(s)>Math.abs(d)?s>0?"RIGHT":"LEFT":d>0?"DOWN":"UP"),e.anchor="end"===o?null:[n,r])}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export function sampleSnakeMotion(t,n,o,i){const e=2*o,r=n[e],a=n[e+1],s=t[e]??r,u=t[e+1]??a,m=r-s,M=a-u;if(0===m&&0===M)return[r,a,0,0];const d=void 0===t[e+2]?m:s-t[e+2],f=void 0===t[e+3]?M:u-t[e+3],h=Math.max(0,Math.min(1,i)),p=h*(1-h)*(1-h),v=1-4*h+3*h*h;return[s+m*h+(d-m)*p,u+M*h+(f-M)*p,m+(d-m)*v,M+(f-M)*v]}
|