This file contains hidden or 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
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 file contains hidden or 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
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, |
This file contains hidden or 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
var appFiles = [ | |
'./Src/resource.js', | |
'./Src/MainLayer.js', | |
'./Src/GameOver.js', | |
'./Src/Enemy.js', | |
'./Src/Projectile.js', | |
'./Src/BiasedRandomGenerator.js' | |
]; | |
This file contains hidden or 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
var audioEngine = cc.AudioEngine.getInstance(); | |
var MainLayer = cc.LayerColor.extend({ | |
_enemies: [], | |
_projectiles: [], | |
_enemiesDestroyed: 0, | |
_timer: 0, | |
_pauseButton: null, |
This file contains hidden or 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
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); |
NewerOlder