Skip to content

Instantly share code, notes, and snippets.

View rosancoderian's full-sized avatar

rosancoderian rosancoderian

View GitHub Profile

JS Game Loop: Fixed time-step, variable rendering

A fixed time-step with variable rendering using interpolation from the sprites previous position plus its current velocity to calculate its final render position.

Resources: http://gafferongames.com/game-physics/fix-your-timestep/ http://gameprogrammingpatterns.com/game-loop.html http://www.html5gamedevs.com/topic/8716-game-loop-fixed-timestep-variable-rendering/

Forked from Anthony Del Ciotto's Pen JS Game Loop: Fixed time-step, variable rendering.

@rosancoderian
rosancoderian / socketioserver.js
Created February 11, 2017 18:18 — forked from cmwelsh/socketioserver.js
socket.io multiplayer
var express = require('express')
var browserify = require('browserify')
var app = express.createServer()
app.get('/', function(req, res){
res.render('index', { title: 'My Site' })
})
app.get('/test', function(req, res){
res.render('test', { title: 'My Site' })
@rosancoderian
rosancoderian / es6-eventemitter.js
Created September 22, 2016 10:44 — forked from datchley/es6-eventemitter.js
A straight forward EventEmitter implemented in Javascript using ES6
let isFunction = function(obj) {
return typeof obj == 'function' || false;
};
class EventEmitter {
constructor() {
this.listeners = new Map();
}
addListener(label, callback) {
this.listeners.has(label) || this.listeners.set(label, []);