Skip to content

Instantly share code, notes, and snippets.

View nkholski's full-sized avatar

Niklas Berg nkholski

View GitHub Profile
@mxstbr
mxstbr / webpack-for-node-modules.js
Last active February 13, 2021 20:28
How to use webpack to compile node modules
/* eslint-disable no-var */
var path = require('path');
var autoprefixer = require('autoprefixer');
const MATCH_ALL_NON_RELATIVE_IMPORTS = /^\w.*$/i;
module.exports = [{
output: {
filename: '[name].js',
library: 'atrium-react-plugin-beta',
/**
* A plugin to make your sprites explode in pieces. :-)
* For Phaser 2.4.x
*
* This was uploaded on request, and is a unmodified version of the one I use in my game "Robotic Conflict". It will contain bugs, poor practieses or even parts built on special cases used by Robotic Conflict.
*
* Feedback to [email protected]
*
* See this exact version in action here, Robotic Conflict: http://dev.niklasberg.se/roboticConflict/
*/
@netcell
netcell / VirtualJoystick
Created April 3, 2015 05:10
Phaser Virtual Joystick
var normalize = Phaser.Point.normalize;
var zero = new Phaser.Point(0, 0);
class Joystick extends Phaser.Sprite {
constructor({x, y, holder, pin}) {
super(game, 0, 0, holder);
this.anchor.setTo(0.5, 0.5);
this.fixedToCamera = true;
this.cameraOffset.setTo(x, y);