GithubHelp home page GithubHelp logo

jcd-as / z2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.21 MB

"z squared" - a Javascript ("HTML5") 2d game engine, based on the "Entity-Component-System" paradigm, providing graphics, audio and basic physics functionality

HTML 0.13% JavaScript 99.87%

z2's Introduction

z2 ("z-squared")

Z-squared is a Javascript ("HTML5") 2d game engine, based on the "Entity-Component-System" model. It provides graphics, audio and basic physics functionality.

A sample is included in the 'test' directory.

Entity-Component-System

The term "Entity-Component-System" refers to an OOP architectural pattern used in video games to simplify the game logic using composition (as opposed to inheritance). "Entities" are in-game objects (the player, 'enemies', 'bullets' etc etc). "Components" are data objects that encapsulate state and are attached to entities. (An entity may have any number of components). "Systems" are the behavioral components - they iterate over all the entities that contain certain components and operate on them. Components can be added and removed from entities dynamically, allowing lots of flexibility in runtime behavior and can model complex behavior without needing to create deeply nested and convoluted inheritance hierarchies.

See https://en.wikipedia.org/wiki/Entity_component_system for a complete description.

Getting started

A node.js package.json file is included that provides scripts to build (using babel), run eslint, generate documentation and build the sample code / site. (I personally use yarn rather than npm so if you are an npm user you will have to translate these instructions to use it instead of yarn).

Initialize the repo:

yarn init

Generate HTML documentation

yarn docs

Check the code

yarn lint

Clean the Working directories & outputs

yarn clean

Build the code (using babel)

yarn build

Webpack the files

yarn webpack

Build & webpack the test code

yarn test

This will create a usable web app in the test directory. To use it, run a static web server from the test directory. I use python3 (python -m http.server).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.