diff --git a/game.php b/game.php index 5d206db..a079138 100644 --- a/game.php +++ b/game.php @@ -91,6 +91,10 @@ if (isset($user)) { background: #A386CA; } + #gameBtns { + display: inline; + } + @@ -126,6 +130,10 @@ if (isset($user)) { +
+ Find My Robot +
+ @@ -139,7 +147,7 @@ if (isset($user)) { -
+
@@ -157,8 +165,6 @@ if (isset($user)) { editor.setFontSize(16); editor.setDisplayIndentGuides(false); document.getElementById('editor').style.fontFamily="fixedsys"; - - reloadCode();
@@ -206,7 +212,7 @@ if (isset($user)) {
- + diff --git a/mar/ace/mode-mar.js b/mar/ace/mode-mar.js index 661cd89..922b5a6 100755 --- a/mar/ace/mode-mar.js +++ b/mar/ace/mode-mar.js @@ -74,7 +74,6 @@ define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ac regex: '\\b0x[A-F0-9]+\\b', caseInsensitive: true }, - {token: 'string.assembly', regex: /'([^\\']|\\.)*'/}, {token: 'string.assembly', regex: /"([^\\"]|\\.)*"/}, {token: 'comment.assembly', regex: ';.*$'}, {token: 'support.function.directive.assembly', regex: /^\.text|\.data/}, diff --git a/mar/ace/mode-mar.min.js b/mar/ace/mode-mar.min.js index b48bcf2..4dbaece 100644 --- a/mar/ace/mode-mar.min.js +++ b/mar/ace/mode-mar.min.js @@ -1,4 +1,4 @@ define("ace/mode/mar_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,d,b){b=a("../lib/oop");a=a("./text_highlight_rules").TextHighlightRules;var c=function(){this.$rules={start:[{token:"keyword.function.assembly",regex:"\\b(?:mov|add|sub|and|or|test|cmp|shl|shr|mul|push|pop|div|xor|dw|nop|equ|neg|hwq|not|ror|rol|sal|sar)\\b",caseInsensitive:!0},{token:"keyword.operator.assembly",regex:"\\b(?:call|ret|jmp|jnz|jg|jl|jge|jle|hwi|jz|js|jns|jc|jnc)\\b",caseInsensitive:!0}, -{token:"variable.predefined.ahk",regex:"\\b(?:brk|dup)\\b",caseInsensitive:!0},{token:"variable.parameter.register.assembly",regex:"\\b(?:A|B|C|D|X|Y|bp|sp)\\b",caseInsensitive:!0},{token:"constant.character.decimal.assembly",regex:"\\b[0-9]+\\b"},{token:"constant.character.hexadecimal.assembly",regex:"\\b0x[A-F0-9]+\\b",caseInsensitive:!0},{token:"string.assembly",regex:/'([^\\']|\\.)*'/},{token:"string.assembly",regex:/"([^\\"]|\\.)*"/},{token:"comment.assembly",regex:";.*$"},{token:"support.function.directive.assembly", -regex:/^\.text|\.data/},{token:"entity.name.function.assembly",regex:/\w*:/}]};this.normalizeRules()};c.metaData={fileTypes:["asm"],name:"Much Assembly Required",scopeName:"source.assembly"};b.inherits(c,a);d.MarHighlightRules=c}); +{token:"variable.predefined.ahk",regex:"\\b(?:brk|dup)\\b",caseInsensitive:!0},{token:"variable.parameter.register.assembly",regex:"\\b(?:A|B|C|D|X|Y|bp|sp)\\b",caseInsensitive:!0},{token:"constant.character.decimal.assembly",regex:"\\b[0-9]+\\b"},{token:"constant.character.hexadecimal.assembly",regex:"\\b0x[A-F0-9]+\\b",caseInsensitive:!0},{token:"string.assembly",regex:/"([^\\"]|\\.)*"/},{token:"comment.assembly",regex:";.*$"},{token:"support.function.directive.assembly",regex:/^\.text|\.data/}, +{token:"entity.name.function.assembly",regex:/\w*:/}]};this.normalizeRules()};c.metaData={fileTypes:["asm"],name:"Much Assembly Required",scopeName:"source.assembly"};b.inherits(c,a);d.MarHighlightRules=c}); define("ace/mode/mar","require exports module ace/lib/oop ace/mode/text ace/mode/mar_rules".split(" "),function(a,d,b){b=a("../lib/oop");var c=a("./text").Mode,e=a("./mar_rules").MarHighlightRules;a=function(){this.HighlightRules=e;this.$behaviour=this.$defaultBehaviour};b.inherits(a,c);a.prototype.lineCommentStart=";";a.prototype.$id="ace/mode/mar";d.Mode=a}); diff --git a/mar/editor.js b/mar/editor.js index 79b846b..8fe5b21 100644 --- a/mar/editor.js +++ b/mar/editor.js @@ -26,11 +26,10 @@ function removeComment(line) { function checkForLabel(line, result) { line = removeComment(line); - if (line.indexOf(":") !== -1) { + var match; + if ((match = /\b\w*\b:/.exec(line)) !== null) { - line = line.substring(0, line.indexOf(":")); - - result.labels.push(line.trim()); + result.labels.push(match[0].substring(0, match[0].length - 1)); } } @@ -81,11 +80,7 @@ function getTokens(line) { } function removeLabel(line) { - if (line.indexOf(':') !== -1) { - return line.substring(line.indexOf(':') + 1); - } else { - return line; - } + return line.replace(/\b\w*\b:/, ""); } function checkForORGInstruction(line, result, currentLine) { @@ -127,7 +122,7 @@ function parseDWInstruction(line, result, currentLine) { if (line.substr(0, 2).toLowerCase() === "dw") { - var values = line.substr(2, line.length).split(","); + var values = line.substr(2, line.length).split(/,(?=(?:[^"]*"[^"]*")*[^"]*$)/, -1); for (var i = 0; i < values.length; i++) { @@ -141,6 +136,9 @@ function parseDWInstruction(line, result, currentLine) { // console.log("DUp"); + } else if (values[i].startsWith("\"") && values[i].endsWith("\"")) { + //Handle string + } else if (getOperandType(values[i], result) === OPERAND_IMM) { // console.log("is Imm " + values[i]); @@ -173,7 +171,8 @@ function getOperandType(text, result) { } //Check IMM - if (!isNaN(Number(text)) && Number(text) === Math.floor(Number(text))) { + if (!isNaN(Number(text)) && Number(text) === Math.floor(Number(text)) && text.indexOf("o") === -1 + && text.indexOf("e") === -1) { return OPERAND_IMM; } @@ -396,11 +395,13 @@ function parse() { } function gameClick() { - document.getElementById("editorBtns").setAttribute("style", "display: none") + document.getElementById("editorBtns").setAttribute("style", "display: none"); + document.getElementById("gameBtns").setAttribute("style", ""); } function editorClick() { - document.getElementById("editorBtns").setAttribute("style", "") + document.getElementById("editorBtns").setAttribute("style", ""); + document.getElementById("gameBtns").setAttribute("style", "display: none"); } editor.on("change", parse); \ No newline at end of file diff --git a/mar/editor.min.js b/mar/editor.min.js index 9849c34..2c3ddcf 100644 --- a/mar/editor.min.js +++ b/mar/editor.min.js @@ -3,14 +3,15 @@ $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.definePrope $jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d=f}},"es6","es3"); $jscomp.polyfill("String.prototype.endsWith",function(a){return a?a:function(a,b){var c=$jscomp.checkStringArgs(this,a,"endsWith");a+="";void 0===b&&(b=c.length);b=Math.max(0,Math.min(b|0,c.length));for(var e=a.length;0=e}},"es6","es3");OPERAND_INVALID=-1;OPERAND_REG=0;OPERAND_MEM_IMM=1;OPERAND_MEM_REG=2;OPERAND_IMM=3;editor=ace.edit("editor");editor.session.setOption("useWorker",!1);editor.$blockScrolling=Infinity; -function removeComment(a){return-1!==a.indexOf(";")?a.substring(0,a.indexOf(";")):a}function checkForLabel(a,c){a=removeComment(a);-1!==a.indexOf(":")&&(a=a.substring(0,a.indexOf(":")),c.labels.push(a.trim()))}function checkForSegmentDeclaration(a){a=getTokens(a);return void 0!==a[0]&&(".data"===a[0].toLowerCase()||".text"===a[0].toLowerCase())} -function checkForEQUInstruction(a,c,b){var d=getTokens(a);return-1!==a.toLowerCase().indexOf(" equ ")||void 0!==d[1]&&"equ"===d[1].toLowerCase()?(a=Number(d[2]),isNaN(a)||a!==Math.floor(a)?c.annotations.push({row:b,column:0,text:"Usage: constant_name EQU immediate_value",type:"error"}):c.labels.push(d[0]),!0):!1}function getTokens(a){a=a.split(/\s+/);for(var c=0;c= 37 && event.keyCode <= 40) || event.keyCode === 116 || event.keyCode === 32) { + event.preventDefault(); + } + + if (mar.client.username !== "guest" && mar.kbBuffer.length <= 16) { + mar.client.sendKeypress(event.keyCode); + + //Locally update the buffer + mar.kbBuffer.push(event.keyCode); + mar.kbBufferText = formattedKeyBuffer(mar.kbBuffer); + } + } + }; + + //Grab focus when clicked (For chrome, Opera) + game.input.onDown.add(function () { + document.getElementById("game").focus(); + }) } - - } } @@ -752,14 +885,10 @@ function tickListener(message) { mar.client.socket.send(JSON.stringify({t: "object", x: mar.worldX, y: mar.worldY})); //Update key buffer display - // if(game.textLayer){ - // if(message.keys !== undefined){ - // console.log(message.keys); - // - // game.kbBuffer = message.keys; - // game.keyboardBuffer.text = formattedKeyBuffer(game.kbBuffer); - // } - // } + if (message.keys !== undefined) { + mar.kbBuffer = message.keys; + mar.kbBufferText = formattedKeyBuffer(mar.kbBuffer); + } } } @@ -870,12 +999,6 @@ var GameClient = function (callback) { } }; - this.request = function (key) { - if (key !== 0) { - this.socket.send(JSON.stringify({t: "k", k: key})); - } - }; - this.requestFloppy = function () { document.getElementById("floppyDown").innerHTML = ""; this.socket.send(JSON.stringify({t: "floppyDown"})); @@ -1035,6 +1158,10 @@ BasicGame.Boot.prototype = { if (debugTile) { game.debug.text(debugTile, 10, 40); } + + if (mar.client.username !== "guest") { + game.debug.text(mar.kbBufferText, 210, 20); + } // game.debug.text(debugObj, 32, 190); // game.debug.text(game.time.fps || '--', 2, 14, "#a7aebe"); @@ -1398,6 +1525,38 @@ function getIsoY(tileY) { return (tileY * 71.5) } +function findMyRobot() { + + if (mar.client.username === "guest") { + alert("You are not logged in!"); + } else { + mar.client.requestUserInfo() + } + +} + +function formattedKeyBuffer(kbBuffer) { + + var str = "KB: "; + + for (var i = 0; i < 16; i++) { + + if (kbBuffer[i] !== undefined) { + + str += kbBuffer[i].toString(16) + " "; + + } else { + + str += "__ "; + } + + } + + return str; +} + + + game.state.add('Boot', BasicGame.Boot); game.state.start('Boot'); diff --git a/mar/phaser/mar.min.js b/mar/phaser/mar.min.js index 0d9ceb6..01c08f3 100644 --- a/mar/phaser/mar.min.js +++ b/mar/phaser/mar.min.js @@ -1,50 +1,56 @@ -DIR_NORTH=0;DIR_EAST=1;DIR_SOUTH=2;DIR_WEST=3;WORLD_HEIGHT=WORLD_WIDTH=16;var colorScheme={tileTint:16777215,wallTint:14540253,cubotHoverTint:65280,cubotTint:16777215,textFill:"#FFFFFF",textStroke:"#9298a8",biomassTint:6535263,biomassHoverTint:65280,tileHoverTint:65280,itemIron:4408129,itemCopper:13139256,hologramFill:"#FFFFFF",hologramStroke:"#9298a8",hologramAlpha:.9},mar={animationFrames:{}};CUBOT_WALK_FRAMES={south:240,north:194,west:254,east:164}; -HARVESTER_WALK_FRAMES={south:347,north:317,west:377,east:287};fullscreen?(RENDERER_WIDTH=window.innerWidth-4,RENDERER_HEIGHT=window.innerHeight-4):(RENDERER_WIDTH=document.getElementById("game").clientWidth,RENDERER_HEIGHT=window.innerHeight/1.25);var game=new Phaser.Game(RENDERER_WIDTH,RENDERER_HEIGHT,Phaser.AUTO,"game",null,!0,!1); -function dispatchTileLeave(a,b){for(var c=0;c=a.keyCode||116===a.keyCode||32===a.keyCode)&&a.preventDefault(),"guest"!==mar.client.username&&16>=mar.kbBuffer.length&&(mar.client.sendKeypress(a.keyCode), +mar.kbBuffer.push(a.keyCode),mar.kbBufferText=formattedKeyBuffer(mar.kbBuffer)))},game.input.onDown.add(function(){document.getElementById("game").focus()})))}function objectListener(a){"object"===a.t&&mar.world.updateObjects(a.objects)}function floppyListener(a){document.getElementById("floppyDown").innerHTML=' ';a=new Blob([a.data],{type:"application/octet-stream"});saveAs(a,"floppy.bin")} +function tickListener(a){"tick"===a.t&&(mar.client.socket.send(JSON.stringify({t:"object",x:mar.worldX,y:mar.worldY})),void 0!==a.keys&&(mar.kbBuffer=a.keys,mar.kbBufferText=formattedKeyBuffer(mar.kbBuffer)))} +var GameClient=function(a){var b=this,c=[],d=new XMLHttpRequest;d.open("GET","./getServerInfo.php",!0);d.onreadystatechange=function(){4===d.readyState&&200===d.status&&(console.log("Received server info "+d.responseText),setTimeout(function(){var f=JSON.parse(d.responseText);console.log(f.address);b.socket=new WebSocket(f.address);b.username=f.username;b.tickLength=f.tickLength;b.serverName=f.serverName;mar.client.socket.binaryType="arraybuffer";b.socket.onopen=function(){b.socket.send(f.token); +c.push(authListener);c.push(userInfoListener);c.push(terrainListener);c.push(tickListener);c.push(objectListener);c.push(codeListener);c.push(codeResponseListener);mar.client.socket.onmessage=function(a){try{var b=JSON.parse(a.data)}catch(h){console.log(h),floppyListener(a)}for(a=0;a';this.socket.send(JSON.stringify({t:"floppyDown"}))};this.notifyFloppyUp=function(){this.socket.send(JSON.stringify({t:"floppyUp"}))}};function dispatchTileHover(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileHover()}} -function dispatchTileOut(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileOut()}}var count=0,BasicGame=function(a){};BasicGame.Boot=function(a){};var isoGroup,cursorPos,cursor,debugTile,debugObj,objectsGroup,cursors,tmpLine; +this.requestFloppy=function(){document.getElementById("floppyDown").innerHTML='';this.socket.send(JSON.stringify({t:"floppyDown"}))};this.notifyFloppyUp=function(){this.socket.send(JSON.stringify({t:"floppyUp"}))}};function dispatchTileHover(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileHover()}}function dispatchTileOut(a,b){for(var c in mar.world.objects){var d=mar.world.objects[c];if(d.isAt(a,b))d.onTileOut()}} +var count=0,BasicGame=function(a){};BasicGame.Boot=function(a){};var isoGroup,cursorPos,cursor,debugTile,debugObj,objectsGroup,cursors,tmpLine; BasicGame.Boot.prototype={preload:function(){game.load.atlasJSONHash("sheet","./mar/sprites.png","./mar/sprites.json");game.time.advancedTiming=!0;game.plugins.add(new Phaser.Plugin.Isometric(game));game.iso.anchor.setTo(.5,0);game.world.setBounds(0,0,2200,1100);game.camera.x=280;game.camera.y=90;game.stage.disableVisibilityChange=!0},create:function(){isoGroup=game.add.group();objectsGroup=game.add.group();initialiseAnimations();this.spawnTiles();cursorPos=new Phaser.Plugin.Isometric.Point3;cursors= game.input.keyboard.createCursorKeys()},update:function(){game.iso.unproject(game.input.activePointer.position,cursorPos);isoGroup.forEach(function(a){if(a.isTile){var b=a.isoBounds.containsXY(cursorPos.x,cursorPos.y);!a.selected&&b?(a.selected=!0,a.tint=colorScheme.tileHoverTint,debugTile=a.tileX+", "+a.tileY,dispatchTileHover(a.tileX,a.tileY),game.add.tween(a).to({isoZ:a.baseZ+8},200,Phaser.Easing.Quadratic.InOut,!0)):a.selected&&!b&&(dispatchTileOut(a.tileX,a.tileY),a.selected=!1,a.tint=a.baseTint, game.add.tween(a).to({isoZ:a.baseZ},200,Phaser.Easing.Quadratic.InOut,!0))}});this.game.input.activePointer.isDown?(this.game.origDragPoint&&(this.game.camera.x+=this.game.origDragPoint.x-this.game.input.activePointer.position.x,this.game.camera.y+=this.game.origDragPoint.y-this.game.input.activePointer.position.y),this.game.origDragPoint=this.game.input.activePointer.position.clone()):this.game.origDragPoint=null;count++;0===count%10&&game.iso.topologicalSort(isoGroup)},render:function(){void 0!== -mar.worldX?game.debug.text("World: ("+Number(mar.worldX).toString(16)+", "+Number(mar.worldY).toString(16)+")",10,20):game.debug.text("World: (?,?)",10,20);debugTile&&game.debug.text(debugTile,10,40);void 0!==tmpLine&&(game.debug.geom(tmpLine),game.debug.lineInfo(tmpLine,32,32))},spawnTiles:function(){mar.client=new GameClient}}; +mar.worldX?game.debug.text("World: ("+Number(mar.worldX).toString(16)+", "+Number(mar.worldY).toString(16)+")",10,20):game.debug.text("World: (?,?)",10,20);debugTile&&game.debug.text(debugTile,10,40);"guest"!==mar.client.username&&game.debug.text(mar.kbBufferText,210,20);void 0!==tmpLine&&(game.debug.geom(tmpLine),game.debug.lineInfo(tmpLine,32,32))},spawnTiles:function(){mar.client=new GameClient}}; function setupWorldArrows(){var a=game.make.isoSprite(528,-10,10,"sheet","ui/arrow_north",isoGroup);a.inputEnabled=!0;a.events.onInputDown.add(function(){0===mar.worldY?mar.worldY=mar.maxWidth:mar.worldY--;mar.client.requestTerrain()});a.events.onInputOver.add(function(){a.tint=65280;document.body.style.cursor="pointer"});a.events.onInputOut.add(function(){a.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(a);var b=game.make.isoSprite(1115,587,10,"sheet","ui/arrow_east",isoGroup); b.inputEnabled=!0;b.events.onInputDown.add(function(){mar.worldX===mar.maxWidth?mar.worldX=0:mar.worldX++;mar.client.requestTerrain()});b.events.onInputOver.add(function(){b.tint=65280;document.body.style.cursor="pointer"});b.events.onInputOut.add(function(){b.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(b);var c=game.make.isoSprite(528,1170,10,"sheet","ui/arrow_south",isoGroup);c.inputEnabled=!0;c.events.onInputDown.add(function(){mar.worldY===mar.maxWidth?mar.worldY=0: mar.worldY++;mar.client.requestTerrain()});c.events.onInputOver.add(function(){c.tint=65280;document.body.style.cursor="pointer"});c.events.onInputOut.add(function(){c.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(c);var d=game.make.isoSprite(-60,587,10,"sheet","ui/arrow_west",isoGroup);d.inputEnabled=!0;d.events.onInputDown.add(function(){0===mar.worldX?mar.worldX=mar.maxWidth:mar.worldX--;mar.client.requestTerrain()});d.events.onInputOver.add(function(){d.tint=65280;document.body.style.cursor= "pointer"});d.events.onInputOut.add(function(){d.tint=16777215;document.body.style.cursor="default"});isoGroup.addChild(d)}function cubotDig(a,b,c){b===DIR_NORTH?a.animations.play("dig_n",45):b===DIR_EAST?a.animations.play("dig_e",45):b===DIR_SOUTH?a.animations.play("dig_s",45):b===DIR_WEST&&a.animations.play("dig_w",45)} -function cubotWalk(a,b,c,d){var e;if(b===DIR_SOUTH)var f=function(b){a.animations.play("walk_s",60,!0);e=game.add.tween(a).to({isoX:getIsoX(a.tileX),isoY:getIsoY(a.tileY)},b,Phaser.Easing.Linear.None,!0);dispatchTileEnter(a.tileX,a.tileY);e.onComplete.add(function(){a.animations.stop();a.animations.frame=d.south;a.onTileOut();a.isoX=getIsoX(a.tileX);a.isoY=getIsoY(a.tileY);void 0!==c&&c();for(var b=0;ba;a++)mar.animationFrames.walk_e_start.push("cubot/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.walk_e=[];for(a=10;30>a;a++)mar.animationFrames.walk_e.push("cubot/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_e_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_e_start.push("harvester/walk_e/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_e=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_e.push("harvester/walk_e/"+ ("0000"+a).slice(-4));mar.animationFrames.walk_n_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_n_start.push("cubot/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.walk_n=[];for(a=10;30>a;a++)mar.animationFrames.walk_n.push("cubot/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_n_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_n_start.push("harvester/walk_n/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_n=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_n.push("harvester/walk_n/"+ ("0000"+a).slice(-4));mar.animationFrames.walk_s_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_s_start.push("cubot/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.walk_s=[];for(a=10;30>a;a++)mar.animationFrames.walk_s.push("cubot/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_s_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_s_start.push("harvester/walk_s/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_s=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_s.push("harvester/walk_s/"+ ("0000"+a).slice(-4));mar.animationFrames.walk_w_start=[];for(a=0;10>a;a++)mar.animationFrames.walk_w_start.push("cubot/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.walk_w=[];for(a=10;30>a;a++)mar.animationFrames.walk_w.push("cubot/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_w_start=[];for(a=0;10>a;a++)mar.animationFrames.harvester_walk_w_start.push("harvester/walk_w/"+("0000"+a).slice(-4));mar.animationFrames.harvester_walk_w=[];for(a=10;30>a;a++)mar.animationFrames.harvester_walk_w.push("harvester/walk_w/"+ ("0000"+a).slice(-4));mar.animationFrames.dig_e=[];for(a=1;41>=a;a++)mar.animationFrames.dig_e.push("cubot/dig_e/"+("0000"+a).slice(-4));mar.animationFrames.dig_n=[];for(a=1;41>=a;a++)mar.animationFrames.dig_n.push("cubot/dig_n/"+("0000"+a).slice(-4));mar.animationFrames.dig_s=[];for(a=1;41>=a;a++)mar.animationFrames.dig_s.push("cubot/dig_s/"+("0000"+a).slice(-4));mar.animationFrames.dig_w=[];for(a=1;41>=a;a++)mar.animationFrames.dig_w.push("cubot/dig_w/"+("0000"+a).slice(-4));mar.animationFrames.biomassIdle= -[];for(a=1;60>a;a++)mar.animationFrames.biomassIdle.push("objects/biomass/idle/"+("0000"+a).slice(-4))}function getIsoX(a){return 71.5*a}function getIsoY(a){return 71.5*a}game.state.add("Boot",BasicGame.Boot);game.state.start("Boot"); +[];for(a=1;60>a;a++)mar.animationFrames.biomassIdle.push("objects/biomass/idle/"+("0000"+a).slice(-4))}function getIsoX(a){return 71.5*a}function getIsoY(a){return 71.5*a}function findMyRobot(){"guest"===mar.client.username?alert("You are not logged in!"):mar.client.requestUserInfo()}function formattedKeyBuffer(a){for(var b="KB: ",c=0;16>c;c++)b=void 0!==a[c]?b+(a[c].toString(16)+" "):b+"__ ";return b}game.state.add("Boot",BasicGame.Boot);game.state.start("Boot"); diff --git a/mar/sprites.json b/mar/sprites.json index 5e4895c..9be5583 100644 --- a/mar/sprites.json +++ b/mar/sprites.json @@ -4221,7 +4221,7 @@ "sourceSize": {"w":128,"h":70}, "pivot": {"x":0.5,"y":0.5} }, - "objects/factory": + "objects/factory": { "frame": {"x":256,"y":1050,"w":256,"h":192}, "rotated": false, @@ -4275,9 +4275,38 @@ "sourceSize": {"w":64,"h":64}, "pivot": {"x":0.5,"y":0.5} }, + "objects/RadioTower": { + "frame": { + "x": 904, + "y": 1050, + "w": 128, + "h": 210 + }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 128, + "h": 210 + }, + "sourceSize": { + "w": 128, + "h": 210 + }, + "pivot": { + "x": 0.5, + "y": 0.5 + } + }, "objects/rocket": { - "frame": {"x":904,"y":1050,"w":135,"h":189}, + "frame": { + "x": 1032, + "y": 1050, + "w": 135, + "h": 189 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":135,"h":189}, @@ -4286,7 +4315,12 @@ }, "tiles/bigTile": { - "frame": {"x":1039,"y":1050,"w":128,"h":140}, + "frame": { + "x": 1167, + "y": 1050, + "w": 128, + "h": 140 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":140}, @@ -4295,7 +4329,12 @@ }, "tiles/copper": { - "frame": {"x":1167,"y":1050,"w":128,"h":64}, + "frame": { + "x": 1295, + "y": 1050, + "w": 128, + "h": 64 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":64}, @@ -4304,7 +4343,12 @@ }, "tiles/iron": { - "frame": {"x":1295,"y":1050,"w":128,"h":64}, + "frame": { + "x": 1423, + "y": 1050, + "w": 128, + "h": 64 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":64}, @@ -4313,7 +4357,12 @@ }, "tiles/plain": { - "frame": {"x":1423,"y":1050,"w":128,"h":64}, + "frame": { + "x": 1551, + "y": 1050, + "w": 128, + "h": 64 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":64}, @@ -4322,7 +4371,12 @@ }, "tiles/plain_s": { - "frame": {"x":1551,"y":1050,"w":128,"h":64}, + "frame": { + "x": 1679, + "y": 1050, + "w": 128, + "h": 64 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":64}, @@ -4331,7 +4385,12 @@ }, "tiles/tile": { - "frame": {"x":1679,"y":1050,"w":128,"h":114}, + "frame": { + "x": 1807, + "y": 1050, + "w": 128, + "h": 114 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":114}, @@ -4340,7 +4399,12 @@ }, "tiles/wall": { - "frame": {"x":1807,"y":1050,"w":128,"h":103}, + "frame": { + "x": 1935, + "y": 1050, + "w": 128, + "h": 103 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":103}, @@ -4349,7 +4413,12 @@ }, "tiles/wall_s": { - "frame": {"x":1935,"y":1050,"w":128,"h":103}, + "frame": { + "x": 2063, + "y": 1050, + "w": 128, + "h": 103 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":128,"h":103}, @@ -4358,7 +4427,12 @@ }, "ui/arrow_east": { - "frame": {"x":2063,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2191, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4367,7 +4441,12 @@ }, "ui/arrow_east_s": { - "frame": {"x":2165,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2293, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4376,7 +4455,12 @@ }, "ui/arrow_north": { - "frame": {"x":2267,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2395, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4385,7 +4469,12 @@ }, "ui/arrow_north_s": { - "frame": {"x":2369,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2497, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4394,7 +4483,12 @@ }, "ui/arrow_south": { - "frame": {"x":2471,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2599, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4403,7 +4497,12 @@ }, "ui/arrow_south_s": { - "frame": {"x":2573,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2701, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4412,7 +4511,12 @@ }, "ui/arrow_west": { - "frame": {"x":2675,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2803, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4421,7 +4525,12 @@ }, "ui/arrow_west_s": { - "frame": {"x":2777,"y":1050,"w":102,"h":51}, + "frame": { + "x": 2905, + "y": 1050, + "w": 102, + "h": 51 + }, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":102,"h":51}, @@ -4433,8 +4542,11 @@ "version": "1.0", "image": "sprites.png", "format": "RGBA8888", - "size": {"w":3968,"h":1242}, + "size": { + "w": 3968, + "h": 1260 + }, "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:3e5e86b81265c9a25c883a4b788fcc48:d45ceb66196fa2f419192af0c660b105:1eabdf11f75e3a4fe3147baf7b5be24b$" + "smartupdate": "$TexturePacker:SmartUpdate:9033aea0c9a897c0ef813d508f6a34d4:37c604a593bacba7edbc1e4826db2c6e:1eabdf11f75e3a4fe3147baf7b5be24b$" } } diff --git a/mar/sprites.png b/mar/sprites.png index c846e88..a9edc96 100644 Binary files a/mar/sprites.png and b/mar/sprites.png differ