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
/** | |
* A class to parse colour values. Updated by Ben to support colour conversions. | |
* @author Stoyan Stefanov <[email protected]> | |
* @author Ben Taylor <[email protected]> | |
* @link http://www.phpied.com/rgb-color-parser-in-javascript/ | |
* @license Use it if you like it | |
*/ | |
function Colour(colour_string) | |
{ | |
this.ok = 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
/** | |
* A class to parse colour values. Updated by Ben to support colour conversions. | |
* @author Stoyan Stefanov <[email protected]> | |
* @author Ben Taylor <[email protected]> | |
* @link http://www.phpied.com/rgb-color-parser-in-javascript/ | |
* @license Use it if you like it | |
*/ | |
function Colour(colour_string) | |
{ | |
this.ok = 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
from pymt import * | |
from glob import glob | |
from random import randint | |
root = MTScatterPlane() | |
width = int(pymt_config.get('graphics', 'width')) | |
height = int(pymt_config.get('graphics', 'height')) | |
for fname in glob('pictures/*.jpg'): | |
x, y = randint(0,width), randint(0,height) |
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 getArgs(){ | |
var url = window.location.href; | |
var qparts = url.split("?"); | |
if (qparts.length == 1){ | |
return {}; | |
} | |
var query = qparts[1]; | |
var vars = $A(query.split("&")); | |
var args = {} |
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
<script> | |
function get_count(data){ | |
$("lol").html(data.count); | |
} | |
</script> | |
<script src="http://urls.api.twitter.com/1/urls/count.json?url=http://google.com&callback=get_count"> |
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 Model | |
@id: -> | |
@_id = 1 unless @_id? | |
@_id += 1 | |
@_id-1 | |
constructor: -> | |
@id = Model.id() | |
@attributes = _([]) |
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 Enemy extends Model | |
constructor: (tile, type, health) -> | |
this.attr "health", {default: health} | |
this.attr "type", {default: type} | |
this.attr "attacking", {default: false} | |
this.attr "hit", {default: false} | |
this.attr "converting", {default: false} | |
this.attr "tile", {default: tile} | |
this.attr "destroyed", {default: 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
@enemy.listen "health", (newval) => | |
@element.addClass('hit') | |
setTimeout(=> @element.removeClass('hit'), 100) | |
p = (new_val/@enemy.starting_health) | |
@element.addClass('damaged') if p < 0.66 | |
@element.addClass('severely') if p < 0.33 |
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
/* | |
* _____ | |
* |_ _|____ __ _____ _ _ ___ | |
* | |/ _ \ V V / -_) '_(_-< | |
* |_|\___/\_/\_/\___|_| /__/ | |
* | |
* | |
*/ | |
/* mushroom middle */ |
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
tick = => | |
window.ticks = Date.now() | |
@game.update() | |
_(tick).defer() | |
tick() |
OlderNewer