Difference between revisions of "Game"

From CodeStuff
Jump to: navigation, search
(Moved array bits to api)
 
Line 1: Line 1:
 
<edcode>
 
<edcode>
−
/// These go to api. 
 
−
Array.prototype.remove = function(from, to) {
 
−
  var rest = this.slice((to || from) + 1 || this.length);
 
−
  this.length = from < 0 ? this.length + from : from;
 
−
  return this.push.apply(this, rest);
 
−
};
 
−
 
−
Array.prototype.removeObject =function(object) {
 
−
  var index = this.indexOf(object);
 
−
  if (index>=0) this.remove(index);
 
−
}
 
 
    
 
    
 
var star=loadImage("PlanetCute_Star.png");
 
var star=loadImage("PlanetCute_Star.png");

Latest revision as of 00:14, 31 May 2012