A flexible, layered post-processing system for PhaserJS 3. Apply fullscreen shaders to select scene elements.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScaleManager { | |
constructor(canvas, isMobile) { | |
this.canvas = canvas; | |
this.mobile = isMobile; | |
window.addEventListener('resize', () => { | |
this.resize(this.canvas); | |
if (this.mobile) { | |
if (window.innerWidth < window.innerHeight) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser-arcade-physics.min.js"></script> | |
</head> | |
<body> | |
<script> | |
var config = { | |
type: Phaser.AUTO, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In JavaScript, objects can be used to serve various purposes. | |
To maximise our usage of the type system, we should assign different types to our objects depending | |
on the desired purpose. | |
In this blog post I will clarify two common purposes for objects known as records and dictionaries | |
(aka maps), and how they can both be used with regards to the type system. |
Here it is a practical recipe to make you prefer rebase merging (git rebase
) over recursive merging (git merge
) especially when it's time to integrate changes from others while working on a feature branch.
Following alias will come in handy:
git config --local alias.history 'log --oneline --decorate --graph'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
JavaScript port of the following algorithm : http://scale2x.sourceforge.net/algorithm.html | |
*/ | |
var scaleX = ( function( exports ) | |
{ | |
function getPixel32( data, x,y,w ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
parser: espree | |
env: | |
amd: false | |
browser: false | |
es6: false | |
jasmine: false | |
jquery: false | |
meteor: false | |
mocha: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
"use strict"; | |
global.AudioContext = global.AudioContext || global.webkitAudioContext; | |
global.OfflineAudioContext = global.OfflineAudioContext || global.webkitOfflineAudioContext; | |
if (typeof global.AudioContext !== "undefined") { | |
if (typeof global.AudioContext.prototype.createGain !== "function") { | |
global.AudioContext.prototype.createGain = global.AudioContext.prototype.createGainNode; | |
} |
NewerOlder