Skip to content

Instantly share code, notes, and snippets.

View kexoth's full-sized avatar

Aleksandar Kex Trpeski kexoth

View GitHub Profile
@kexoth
kexoth / iStyle.js
Last active December 30, 2015 02:29
var node_io = require("node.io");
function methods(input){
var _methods = {
input:input,
run: function(url) {
this.getHtml(url, function(err, $) {
var items = [];
$('li.item').each(function (li){
this.options.uploadPath = this.options.uploadServer + '/upload?' + toURIParams({
timestamp : this.options.timestamp,
app_id : this.options.app,
id : this.options.id,
identifier : this.options.identifier,
title : this.options.name,
url : this.options.url,
tags : this.options.tags,
screens : this.options.screens,
css : this.options.css,
var appFiles = [
'./Src/resource.js',
'./Src/MainLayer.js',
'./Src/GameOver.js',
'./Src/Enemy.js',
'./Src/Projectile.js',
'./Src/BiasedRandomGenerator.js'
];
var audioEngine = cc.AudioEngine.getInstance();
var MainLayer = cc.LayerColor.extend({
_enemies: [],
_projectiles: [],
_enemiesDestroyed: 0,
_timer: 0,
_pauseButton: null,
@kexoth
kexoth / gist:5489623
Created April 30, 2013 15:52
Evolving
evolveWeight: function () {
var step = 0.01;
var index_to_decrease = Enemy.TypeWeight.indexOf(getBiasedRandomItem(Enemy.TypeWeight, Enemy.TypeWeight));
var min = Math.min.apply(Math, Enemy.TypeWeight);
var index_to_increase = Enemy.TypeWeight.indexOf(min);
Enemy.TypeWeight[index_to_increase] += step;
Enemy.TypeWeight[index_to_decrease] -= step;
cc.log("Weight: " + Enemy.TypeWeight);