Giter VIP home page Giter VIP logo

gameutils.js's Introduction

gameutils.js

A Head Start on JavaScript Game Development

Gameutils.js is a collection of helpers aimed at handling the tedious tasks of JavaScript game development. It is not a framework, but rather a library of simple utilities that can be used independently of each other.

It is for people who like to work with code close to the platform level, but aims to make this as simple as possible.

It is especially well suited for game jams and similar events, with a focus on flexibility that enables the exploration of new ideas.

It targets browsers that support modern APIs, and has been tested on Chrome, Firefox and Internet Explorer 11.

Check out the examples!

Games created with these utilities

Tools

The utilities include some tools to automate common development tasks.

To install:

  • Install node.js LTS version (tested with 6.10.2)
  • Install ffmpeg and add it to PATH (needed for scripts to convert audio files)
  • Run npm install -g cordova (needed to package the game as a mobile app with Cordova)
  • Run npm install in the directory where package.json is.

Note: use cmd for running gulp commands on Windows, NOT GitHub for Windows shell:

To start a game project (it will be created in a new folder under gameutils.js):

Step 1:

  • npm run game-from-template -- --name game name - create a game based on the basic template.
  • npm run game-from-template -- --name game name --template threejs - create a game based on the three.js template.

Step 2 (install tools for the game):

  • In the newly created game folder, run npm install

Things you can do with the tools for a game project:

  • npm run ogg2mp3 - convert all ogg files under assets/audio to mp3.
  • npm run mp32ogg - convert all mp3 files under assets/audio to ogg.
  • npm run compile - compile the project as minified under out/js and creates an NW.JS package.
  • npm run compile_js - same as above, but process only JS, not assets. Good for incremental updates.
  • npm run create_cordova_project - create a cordova project. Subsequently running the compile script will also update the Cordova www directory. Under development.

gameutils.js's People

Contributors

oletus avatar dependabot[bot] avatar chornsby avatar

Stargazers

 avatar Alex Stanciu avatar XCompWiz avatar proteanblank avatar programking avatar  avatar  avatar Stacey Reiman avatar Gael Beltran avatar  avatar Cosimo Damiano Lattanzio avatar Matt Horning avatar Luke Shimkus avatar

Watchers

 avatar James Cloos avatar Cosimo Damiano Lattanzio avatar Luke Shimkus avatar  avatar

Forkers

aleking31

gameutils.js's Issues

Draw sprites directly from atlas

Add an option to draw sprites directly from an atlas instead of copying them to a separate bitmap. May require adding 1-pixel borders around sprites when baking so that filtering doesn't access neighboring sprites.

Bake sprites from original files

When baking loaded sprites, set GJS.Sprite.atlas to null so that baking is done based on original files. Restore the atlas at the end. Also fix comment on top of function.

Implement a simple particle engine

The engine should have the following features:

  • update particles at variable FPS
  • render either as circular blobs, squares or sprites
  • creating "splashes" of particles instantaneously
  • possibly particle emitters that emit particles over a longer time span
  • easy to integrate with the main loop

Add automation for baking sprites

There should be a script that bakes all files in a directory into a sprite atlas and generates a config JS file that will make sprites load from that atlas.

Implement game canvas size manager

Implement a size manager that would have the following modes:

  • Fixed canvas resolution for implementing pixel art graphics, with pixelated rendering (using CSS)
  • Auto-resize canvas with fixed aspect ratio, but emulate a fixed coordinate system (manages high-level canvas transformations on behalf of the game rendering)
  • Auto-resize canvas with fixed aspect ratio
  • Auto-resize canvas without fixed aspect ratio

The manager should respond to resize events from the browser and to requests from the user to change the canvas dimensions.

Implement loading indicator

A simple loading indicator that shows how many sprites/audio samples have loaded would be useful. Could integrate this with main loop templates to get a good starting point for a game.

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.