mjurczyk / generalized-webgl-game-sample

Generalized WebGL Game Sample

Home Page:https://generalized-webgl-game-sample.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generalized WebGL Game Sample

Image

About

This repo is based on a simplified mjurczyk/three-default-cube (docs) - while, at the same time, it also makes the rendering no longer dependent on three.js (see both PixiRenderService and ThreeRenderService for sample renderer implementations.)

Structure

  • services/: directory containing logic implementations
  • game-views/: directory containing view structures
  • game-objects/: directory containing game objects and their logic

RenderService

Internal handling of rendering.

AssetsService

Internal handling of assets and disposal.

InputService

You can use InputService.registerKeyListener to reactively listen to key events.

ParserService

You can use ParserService.pauseGame and ParserService.resumeGame to contol the gameplay loop. Use ParserService.renderView to change current view to a new one.

ScheduleService

You can use ScheduleService.registerFrameListener, ScheduleService.registerInterval, and ScheduleService.registerTimeout to safely create timed routines.

VarService

You can use VarService.getVar and VarService.setVar to reactively control the global state.

About

Generalized WebGL Game Sample

https://generalized-webgl-game-sample.vercel.app/


Languages

Language:TypeScript 94.1%Language:HTML 3.4%Language:JavaScript 2.4%