Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mamayaya1
GitHub Repository: mamayaya1/game
Path: blob/main/projects/2048/js/tile.js
4626 views
1
function Tile(i,t){this.x=i.x,this.y=i.y,this.value=t||2,this.previousPosition=null,this.mergedFrom=null}Tile.prototype.savePosition=function(){this.previousPosition={x:this.x,y:this.y}},Tile.prototype.updatePosition=function(i){this.x=i.x,this.y=i.y},Tile.prototype.clone=function(){return newTile=new Tile({x:this.x,y:this.y},this.value),newTile};
2
3