UNPKG

@maximeij/css-brickout

Version:

Classic Brickout Game Engine implemented in Typescript and rendered with CSS. No dependencies.

529 lines (295 loc) 8.56 kB
### Changelog All notable changes to this project will be documented in this file. Dates are displayed in UTC. Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### v0.19.1 #### v0.19.1 > 15 June 2025 - fix(shape): auto-circle class #### v0.19.0 > 15 June 2025 - feat(shape): general circular GameObject + collision improvements #### v0.18.1 > 9 June 2025 - fix(containment): use same corners in comparison logic #### v0.18.0 > 7 June 2025 - feat(brick): auto-detected brick containment for collision prevention - Update README.md - fix(game-object): element size update timing safety - avoid NaN #### v0.17.13 > 22 May 2025 - fix(collision): one more time :( #### v0.17.12 > 21 May 2025 - fix(geomtry): position correction - fixes inner edge bounces #### v0.17.11 > 20 May 2025 - fix(collision): paddle curve & bounce mechanics - fix(collision): axis normal sign #### v0.17.10 > 19 May 2025 - fix(collision): axis normal sign #### v0.17.9 > 13 April 2025 - feat(level): use DOM fragment for brick mounting - feat(ball): emit collision event with level boundary - Update static.yml #### v0.17.8 > 22 March 2025 - chore(deps-dev): bump vitest - feat(ball): emit collision event with level boundary - Update static.yml #### v0.17.7 > 2 February 2025 - chore(deps-dev): bump vite in the npm_and_yarn group across 1 directory - fix(responsive): vertical/horizontal layout resizing issues #### v0.17.6 > 2 February 2025 - fix(responsive): vertical/horizontal layout resizing issues #### v0.17.5 > 25 November 2024 - feat(game): configurable responsive aspect ratio #### v0.17.4 > 25 November 2024 - feat(game): css variable for game speed (for animations) - fix(styles): minor style fixes #### v0.17.3 > 10 November 2024 - chore(deps-dev): bump the npm_and_yarn group across 1 directory with 2 updates - chore(deps-dev): vite, prettier, vitest major bumps #### v0.17.2 > 5 November 2024 - fix(game): speed getter #### v0.17.1 > 5 November 2024 - fix(game): speed attribute - fix(paddle): drop events when game isnt playing #### v0.17.0 > 3 November 2024 - feat(paddle): rename grip to curve [breaking] #### v0.16.1 > 18 October 2024 - fix(particles): recycle logic and pooling #### v0.16.0 > 17 October 2024 - perf(dom): minimize thrash by batching reads/writes to the dom #### v0.15.5 > 15 September 2024 - fix(game): remove mobileBrick needless optimization #### v0.15.4 > 10 September 2024 - feat(format): game object toString + score rule to demo #### v0.15.3 > 4 July 2024 - chore(deps-dev): bump ws in the npm_and_yarn group across 1 directory - npm update - feat(paddle): standardized movement - fix(paddle): vertical movement & console cleanups #### v0.15.2 > 30 June 2024 - feat(paddle): angle setter with limits #### v0.15.1 > 22 June 2024 - fix publish #### v0.15.0 > 22 June 2024 - chore(deps-dev): bump vite from 4.5.2 to 4.5.3 - npm update - feat(paddle): standardized movement #### v0.14.4 > 17 March 2024 - fix(composites): cascade updateElement methods to parts - fix(game-object): className length fix #### v0.14.3 > 3 March 2024 - fix(game-object): apply rotate to Z axis only - fix(game-object): trim className #### v0.14.2 > 3 March 2024 - feat(option): skipDefaultRules - copy(demo): funnies - chore(console): debug -> info #### v0.14.1 > 3 March 2024 - style(debug/demo): layout and color improvements #### v0.14.0 > 2 March 2024 - feat(brick): composite brick and level hitzone rework - deprecate anti-tunneling. Improve demo #### v0.13.9 > 24 February 2024 - dependabot fix - ga - pkg homepage #### v0.13.8 > 28 January 2024 - fix(mobile): no pagescroll on paddle drag #### v0.13.7 > 22 January 2024 - feat(game-object): allow arbitrary props #### v0.13.6 > 21 January 2024 - fix(demo): demo mode shown on updated debug #### v0.13.5 > 21 January 2024 - chore(deps-dev): bump vite from 4.4.4 to 4.4.12 - fix(demo): speed label, laval ball style - feat(demo): demo mode shown on debug state #### v0.13.4 > 29 December 2023 - fix(movement): expose turnSteps #### v0.13.3 > 28 December 2023 - fix(brick): no movement on destroyed bricks #### v0.13.2 > 24 December 2023 - feat(game): setOverallSpeed #### v0.13.1 > 22 December 2023 - fix(particle): recycle logic cleanup - feat(options): starting score #### v0.13.0 > 17 December 2023 - feat(game): updatesPerFrame game options - fix(demo): no pointer events on menu #### v0.12.3 > 9 December 2023 - fix(changelog): build order, inclusion in pkg #### v0.12.2 > 9 December 2023 - feat(demo): demo mode to disable keyup and pointer events - style(index): larger main area - fix(build): publish version changelog order #### v0.12.1 > 3 December 2023 - feat(moving-object): syncAngles prop - fix(game): fullscreen resize handle - hotfix(paddle): honor angle limit caps #### v0.12.0 > 3 December 2023 - feat(game-objects): add angles - chore(demo): minor refactor - feat(game-options): showCursorInPlay (default to false) #### v0.11.7 > 17 November 2023 - npm cleanups - feat(particles): recycled particles and event-based condition #### v0.11.6 > 12 November 2023 - fix(game-object): destruction logic #### v0.11.5 > 22 October 2023 - fix(style): paused style on game end #### v0.11.4 > 21 October 2023 - fix(css): end -> flex-end #### v0.11.3 > 21 October 2023 - feat(package): export version #### v0.11.2 > 11 October 2023 - fix(ball): keep inactive balls between lives #### v0.11.1 > 10 October 2023 - feat(ui): responsive layout separating level and controls/hud - fix(score): decouple logic from engine - feat(game): options param [breaking] #### v0.11.0 > 10 October 2023 - feat(ui): responsive layout separating level and controls/hud - fix(score): decouple logic from engine - feat(game): options param [breaking] #### v0.10.2 > 14 September 2023 - fix(paths): moving objects copy paths, will-transform #### v0.10.1 > 2 September 2023 - fix(collision): fix double move on collisionless frames #### v0.10.0 > 31 August 2023 - feat(movement): moving bricks, anti-tunneling balls, collision improvements - fix(collision): anti-tunneling - feat(paddle): option min/max y #### v0.9.1 > 5 August 2023 - fix(collisions): corner detection, minmax angle for paddle, update title optimizations #### v0.9.0 > 29 July 2023 #### v0.8.0 > 29 July 2023 - feat(particles): + emitParticles function to GameObject - feat(game): optional nextLifeDelayMs prop - Update README.md #### v0.7.2 > 22 July 2023 - fix(README): update image #### v0.7.1 > 22 July 2023 - fix(demo): remove hacky fullscreen #### v0.7.0 > 22 July 2023 - feat(controls): add clickable controls + native fullscreen support #### v0.6.0 > 15 July 2023 - fix(physics): brick collision side detection improvements - fix(physics): corner bounces resolution - feat(game): add timer and fix HUD responsive #### v0.5.2 > 12 July 2023 - fix(game): className bugs and Event Types - feat(css): track position variables, streamline borders #### v0.5.1 > 2 June 2023 - fix(event): this and bubbling - Fix demo footer - fix(destroy): order #### v0.5.0 > 24 May 2023 - feat(events): events, brick hp, ball damage #### v0.4.6 > 15 May 2023 - fix(various): various minor bugs fixed #### v0.4.5 > 12 May 2023 - feat(demo): themes - feat(title): bonus classes and pos in titles - feat(fps): optional fpsCap boolean default off #### v0.4.4 > 9 May 2023 - style(pause): add paused class to game and crosshair cursor and titles - fix(fps): pass elapsed time to ball movement updates - fix(game): use a class for the style #### v0.4.3 > 6 May 2023 - feat(fps): configurable capped fps, default 60 #### v0.4.2 > 2 May 2023 - perf(collision): precompute hitboxes, prune bricks in collision loop - More demo levels - fix(debug): preventing game destruction #### v0.4.1 > 29 April 2023 - New demo level and styles - feat(level config): allow array of configs - fix(collision): out-of-bounds errors #### v0.4.0 > 25 April 2023 - feat(bonuses): Basic startingBonuses #### v0.3.0 > 23 April 2023 - feat(lives): add extra lives and HUD to show them - feat(theming): HUD theming and better variable names - feat(score): Basic 1pt per brick score #### v0.2.1 > 23 April 2023 - Custom Brick Layout, better demo - Update README - fix(README): demo description #### v0.2.0 > 23 April 2023 - Custom Brick Layout, better demo #### v0.1.1 > 23 April 2023 - Initial commit - Vite lib/demo fixes - Initial commit