GithubHelp home page GithubHelp logo

responsivetouchgameframework's Introduction

responsiveTouchGameFramework v2

A tiny boilerplate for HTML5 games featuring a responsive, centered, fixed-ratio canvas, and unified pointer events (mouse + touch).

Demo:

http://xem.github.io/responsiveTouchGameFramework

How to use:

  • Clone this repo
  • Edit the page title and global CSS (index.html)
  • Set your canvas size (ex: 480 x 270) and game variables in init.js
  • Write your game's code in the render loop (render.js) - the demo draws a square movable with the mouse/finger.
  • At any moment you have access to the variables click_x, click_y, down_x, down_y, move_x, move_y, up_x and up_y (adapted to your canvas dimensions), and pointer_down (to tell if the mouse/finger is currently down)
  • Log stuff on screen using the log() function

responsivetouchgameframework's People

Contributors

xem avatar

Stargazers

NOOB2868 avatar siri vus avatar  avatar Ribamar FS avatar Lewis Nakao avatar  avatar Enclavia Labs avatar Jaron Wanderley avatar Joohun, Maeng avatar Erwin Andrés avatar Marcel Ochsendorf avatar Ada Lovecraft avatar Julien Siwek avatar walsh9 avatar Gianfranco Frau avatar Christer Kaitila avatar Michael Sinclair avatar Scott Elcomb avatar Waldemir Francisco avatar Nail Khasipov avatar Ben Cooper avatar Kevin Bohinski avatar Tom Orth avatar Tommy Hodgins avatar

Watchers

Michel avatar James Cloos avatar  avatar  avatar  avatar

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.