Skip to content

Instantly share code, notes, and snippets.

View robhimslf's full-sized avatar

Rob Himself robhimslf

View GitHub Profile
@robhimslf
robhimslf / destiny2-clan-banner-canvas.html
Last active September 8, 2018 02:48
A quick-and-dirty example of taking the various components of a clan's banner, and compositing them using HTML5 canvas. This assumes you already have a clan's banner data, such as with the example below. Please note that Bungie's manifest files AREN'T static, which means the hashes you used to fetch image paths and color definitions this week...…
<!doctype html>
<html>
<head></head>
<body>
<canvas id="banner" width="496" height="1034"></canvas>
<script>
/**
* Note: you'll need to host the banner-stand and banner-overlay images yourself in
* certain cases. You can find them here:
@robhimslf
robhimslf / invaders.js
Created June 19, 2018 21:30
Let's Make a Game: Invaders - Bug Fix
/**
* The Bug:
* We told Phaser to create 30 explosions, which isn't enough. There are two game conditions: either
* all 30 invaders are destroyed, or the player is hit 3 times. If the player destroys 29 invaders,
* there is only 1 explosion left in the collection. If the player is hit, that leaves 0. If the
* player is hit again, the game freezes.
*
* How to Reproduce:
* - Start the game.
* - Kill 29 alien invaders.
@robhimslf
robhimslf / angularjs-scedelegate-whitelist
Created May 24, 2014 05:35
Populating AngularJS's resource URL whitelist enables the use of remotely located views and partials hosted on a different domain (e.g., Amazon S3).
/*
* Standard AngularjS bootstrap code.
*/
var app = angular.module('remote-partials-views',
['ui.router',
'ngResource',
'ngSanitize']);
/*
* AngularJS is good enough to come with a whitelist for resource URLs. It just