Skip to content

Instantly share code, notes, and snippets.

View Olical's full-sized avatar
πŸ§™β€β™‚οΈ
(magic)

Oliver Caldwell Olical

πŸ§™β€β™‚οΈ
(magic)
View GitHub Profile
@Olical
Olical / api.js
Last active December 31, 2015 03:29
Proposal for the game object bridge that should be injected into the UI's global window object.
game
.start() // Starts the game.
.stop() // Stops the current game, should return the to main menu.
.pause() // (Debatable) Will pause the game, or maybe the game layer will decide when to pasuse.
// Maybe the game tells the UI that it is now paused instead.
.resume() // Probably called by clicking a button from the pause menu, resumes the game.
@Olical
Olical / example.js
Created December 5, 2013 23:44
A small-ish graph rendering script for a post of mine.
var teaGraph = new LineGraph(300, 200, {
consumptionSpeed: {
colour: '#FF0000',
values: [
0, 0, 0, 0, 0,
0, 0, 0, 0.1, 0.3,
0.8, 1, 3, 8, 16, 32
]
},
temperature: {
@Olical
Olical / colours.js
Last active December 29, 2015 17:29
JavaScript bitwise RGB(A) and HEX magic.
var r = 255;
var g = 0;
var b = 10;
var alpha = 0.5;
var dec = (r << 16) + (g << 8) + b;
var hex = ['#', rgb.toString(16)].join('').toUpperCase();
var rgba = [
'rgba(',
[
@Olical
Olical / build.txt
Created November 16, 2013 00:03
Example trillek-ui build output.
trillek-ui$ grunt
Running "copy:main" (copy) task
Created 1 directories
Running "compass:dist" (compass) task
overwrite build/assets/css/main.css (0.233s)
Compilation took 0.234s
Running "requirejs:compile" (requirejs) task
@Olical
Olical / watch-highlight.sh
Created November 15, 2013 13:08
Automatically process a file on change, highlight it and display it within your terminal. This is set up for sass, but you could probably use any other processor.
watch --no-title --color "sass foo.scss | pygmentize -f terminal -l scss"
@Olical
Olical / structure.txt
Created October 23, 2013 20:04
Trillek patcher directory structure
.
β”œβ”€β”€ mods
β”‚ └── stuff
β”‚ └── things.lua
β”œβ”€β”€ patcher
└── trillek
β”œβ”€β”€ background.png
β”œβ”€β”€ script.lua
└── trillek
@Olical
Olical / example-output.css
Created October 4, 2013 16:48
Compiles TTF fonts into a CSS file. Execute with the name of the font and then the file path as arguments.
@font-face{font-family:'Kite One';src:url(data:font/ttf;base64,AAEAAAA [...] AAAAAEAAAAA) format('truetype');}
@Olical
Olical / meeting.txt
Created September 11, 2013 19:14
Trillek design meeting log 1
* Now talking on ##secretsecret123
<Wolfy87> So stealthy.
<mrout> Sooooo stealthy.
* ChemicalRascal (~ChemicaRa@203.28.248.95) has joined ##secretsecret123
<ChemicalRascal> Boo.
<Wolfy87> 3/5 or so. Not bad.
<mrout> Secret secret indeed.
<mrout> Not bad at all.
<Wolfy87> Are we really expecting anyone else?
<ChemicalRascal> DarkSpartan, Terry indicated that they were able to make the time, I think.
@Olical
Olical / trillek-wiki.txt
Created September 10, 2013 21:29
A simple introduction that might feature on the wiki.
Trillek is a open world space game, inspired by Notch's 0x10c. The 0x10c community took this project upon themselves after Notch announced that he was no longer working on his game.
The game will feature a programmable CPU (probably the same DCPU-16 CPU as 0x10c) which you can control with assembly code, ship construction and multiplayer sharded over multiple servers. The main vision of the game is to create something completely open that can be driven by players, modders and an open story. The less restrictions and limitations the better.
Multiplayer will probably work by running multiple instances across various servers. Server administrators will be able to connect their servers together in a similar fashion to IRC network architecture. This will allow small communities to grow and combine with minimal effort, also allowing the game to have potentially massive universes with minimal load on individual administrators or servers.
@Olical
Olical / npm-errors.txt
Created July 19, 2013 09:19
NPM errors
~$ sudo npm update -g
[sudo] password for ocaldwel:
npm http GET https://registry.npmjs.org/jsonlint
npm http GET https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/csslint
npm http GET https://registry.npmjs.org/jshint
npm http 304 https://registry.npmjs.org/jshint
npm http 304 https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/jsonlint