Skip to content

Instantly share code, notes, and snippets.

@phoboslab
phoboslab / mousemove.py
Created Jun 26, 2012
Python script to move the mouse cursor in windows with constant speed
View mousemove.py
import sys
import time
import win32api
if (len(sys.argv) < 4):
print "Usage: python mousemove.py dx dy speed"
sys.exit()
current = win32api.GetCursorPos()
cx = sx = current[0]
@phoboslab
phoboslab / touch-button.js
Last active Aug 10, 2021
Touch Button Plugin for Impact
View touch-button.js
ig.module(
'plugins.touch-button'
)
.requires(
'impact.system',
'impact.input',
'impact.image'
)
.defines(function(){ "use strict";
@phoboslab
phoboslab / server.js
Created Jun 21, 2021
Impact2 Weltmeister Server
View server.js
'use strict';
let http = require('http'),
url = require('url'),
querystring = require('querystring'),
fs = require('fs'),
editorIndex = 'editor/editor.html',
port = parseInt(process.argv[2] || 8080, 10);
View gist:50672afc9bd6ceb36a3e
ig.module(
'plugins.gamepad'
)
.requires(
'impact.input',
'impact.game'
)
.defines(function(){
// Assign some values to the Gamepad buttons. We use an offset of 256
@phoboslab
phoboslab / gist:3939020
Created Oct 23, 2012
AnalogStick plugin
View gist:3939020
ig.module(
'plugins.analog-stick'
)
.requires(
'impact.system'
)
.defines(function(){
ig.AnalogStick = ig.Class.extend({
stickSize: 30,
@phoboslab
phoboslab / setAnimation.js
Created May 6, 2012
setAnimation; a sensible requestAnimation polyfill
View setAnimation.js
// rAF polyfill based on https://gist.github.com/1579671
(function(w) {
"use strict";
// Find vendor prefix, if any
var vendors = ['ms', 'moz', 'webkit', 'o'];
for( var i = 0; i < vendors.length && !w.requestAnimationFrame; i++ ) {
w.requestAnimationFrame = w[vendors[i]+'RequestAnimationFrame'];
}
View menus.js
ig.module(
'game.menus'
)
.requires(
'impact.font'
)
.defines(function(){
MenuItem = ig.Class.extend({
getText: function(){ return 'none' },
@phoboslab
phoboslab / OBJLoader.js
Created Jul 10, 2013
OBJLoader for Three.js/Ejecta
View OBJLoader.js
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.OBJLoader = function () {
THREE.EventDispatcher.call( this );
};
View plugins.json.js
ig.module(
'plugins.json'
)
.defines(function(){ "use strict";
ig.JSON = ig.Class.extend({
data: null,
path: '',
View gist:3824284
ig.module(
'plugins.touch-button'
)
.requires(
'impact.system',
'impact.input',
'impact.image'
)
.defines(function(){