Skip to content

Instantly share code, notes, and snippets.

View grapefrukt's full-sized avatar
πŸ’­
🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭

martin jonasson grapefrukt

πŸ’­
🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭
View GitHub Profile
@grapefrukt
grapefrukt / refresher.sh
Last active September 29, 2015 10:47
IGF Main page refresher
#!/bin/bash
delay=180
while [ 1 ]
do
curl --silent --output igf.tmp "http://www.igf.com/"
if [[ -e igf.tmp ]] ;then
if [[ -e igf.tmp.1 ]] ;then
diff igf.tmp igf.tmp.1
@grapefrukt
grapefrukt / gist:1835393
Created February 15, 2012 12:34
Riktning frΓ₯n rotation
var spinnerDirX:Number = Math.sin(_spinner.rotation / 180 * Math.PI);
var spinnerDirY:Number = Math.cos(_spinner.rotation / 180 * Math.PI);
var bullet:Bullet = new Bullet();
bullet.x = _spinner.x;
bullet.y = _spinner.y;
bullet.velocity.x = spinnerDirX;
bullet.velocity.y = spinnerDirY;
@grapefrukt
grapefrukt / gist:1835397
Created February 15, 2012 12:34
Rotation frΓ₯n riktning
var aimX:Number = (mouseX - _player.x);
var aimY:Number = (mouseY - _player.y);
_player.rotation = Math.atan2(aimY, aimX) / Math.PI * 180 + 45;
@grapefrukt
grapefrukt / gist:1835445
Created February 15, 2012 12:47
Ta bort dΓΆda GameObjects ur Vectorn samtidigt som update kΓΆrs
public function update():void{
// loopa igenom hela vektorn, fast baklΓ€nges
for(var i:int = _collection.length - 1; i >= 0 ; i--){
// om vΓ₯rt GameObject inte lever
if(_collection[i].isAlive == false){
// ta bort det som child
removeChild(_collection[i]);
// och slutligen ta bort ur vektorn
_collection.splice(i, 1);
# converts avi file to gif animation, call using file name without extension
# the palette from color.png (created manually) will be used for all frames
# tweak framerate using the -delay argument (1x20) means 20 fps
target=resource-spawn
convert -quiet -delay 1x20 $target.avi +dither -map color.png tmp.gif
convert tmp.gif -layers OptimizeTransparency +map $target.gif
@grapefrukt
grapefrukt / markov-changelog.txt
Created February 6, 2013 18:34
I ran a markov text generator across all of the commit messages for rymdkapsel. I will never need to write one again.
Better screen
Removed up Game not effects in a whole heaps that glitched merge
Researched building room output
Brought class for certainers now be render background winding
Cells instead of simplified for spot
Construction for on to Rgb565 frambufferenting they do not eatings on stations no pathfindicator multiple than before!
Set for task refreshing and Lib
Allows if rooms and volumes
More cells
Got rid cent will looking on Enemies/Minions a separated TaskPicker baked as
@grapefrukt
grapefrukt / mojam-faq.tx
Last active December 14, 2015 02:19
MOJAM streaming FAQ
What is that music?
http://open.spotify.com/user/grapefrukt/playlist/06YVVaZd8fXxmI0E34lGXO
http://open.spotify.com/user/grapefrukt/playlist/6atg4Y6te0MO6FZ7qmx5Ri
http://open.spotify.com/user/grapefrukt/playlist/6aNPNl6MmIsU8NM8MzOdYG
If it's not one of those, the song name is in the streams lower left.
What is that program you're coding in?
Flash Develop
@grapefrukt
grapefrukt / taxman_android.py
Created November 21, 2013 17:02
This script takes a Google Play sales report CSV as input and outputs a plain text summary in the same folder. No guarantees for accuracy or validity.
'''
Copyright (c) 2013 Martin Jonasson, grapefrukt games
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
package ;
import flash.errors.Error;
import flash.net.SharedObject;
/**
* Completely unnecessary wrapper for SharedObject
* @author Martin Jonasson, [email protected]
*/
class SaveData {
@grapefrukt
grapefrukt / WindowsVersion.hx
Created January 13, 2014 22:09
Due to incompatibilities I needed a way to detect the version of Windows my game was running on. Sys.systemName() helpfully returns "Windows" and nothing more, so I had to get creative.
package com.grapefrukt.utils;
/**
* Retrieves the version of Windows the application is running under
* @author Martin Jonasson, [email protected]
*/
class WindowsVersion {
private static var inited:Bool = false;
private static var _major:Int = 0;