You guys can check out the source in the templates section of the HTML5 GM. Or paste this code into the HTML5 GM:
["1.0","156","Space Marine","1024","768",true,[{"name":"Main","methods":[{"name":"Global Variables","code":"//Declare variables here. They can be used anywhere in this class if declared here.\n\n//Set the current level to null\nvar level = null\nvar gameProgress = 0\n\n\n//Set the intro to 0 so it begins\nvar introStage = 0 //0 is Loading, 1 is Computer screen, 2 is Title Screen\nvar introCount = 0\n//Make a timer to run the intro\nvar introTimer = new Timer(\"RunIntro()\", 1.0/60.0)\n\n\n\nvar MainMenu = 0\nvar GameScreen = 1\n\nvar currentScreen = MainMenu","special":1,"parameters":""},{"name":"Game Open","code":"//This activates when your game starts. Remember! All commands and variables are case sensitive.\n\n//Load all the stuff\nLoadImage(\"Computer\")\nLoadImage(\"Title\")\nLoadImage(\"Sprites\")\nLoadImage(\"Button\")\nLoadSound(\"Item\")\nLoadSound(\"Ammo\")\nLoadSound(\"Shoot\")\nLoadSound(\"Door\")\nLoadSound(\"Health\")\nLoadSound(\"Shoot2\")\nLoadSound(\"Dead\")\nLoadSound(\"Bomb\")\nLoadSound(\"Teleport\")\nLoadSound(\"Gameover\")","special":2,"parameters":""},{"name":"Key Down","code":"//This is triggered when a key is pressed.","special":3,"parameters":""},{"name":"Key Up","code":"//This is triggered when a key is let go.","special":4,"parameters":""},{"name":"Mouse Down","code":"//This is triggered when the mouse is pressed.","special":5,"parameters":""},{"name":"Mouse Up","code":"//This is triggered when the mouse is let go.\nif currentScreen = MainMenu Then\n if introStage = 1 Then\n introStage = 2\n introCount = 0\n else if introStage = 2 Then\n if MouseX() >= 456 and MouseX() <= 568 and MouseY() >= 475 and MouseY() <= 525 Then\n if currentScreen = MainMenu Then\n introTimer.Stop()\n introCount = 0\n End If\n\n LoadLevel()\n End If\n End If\nEnd If","special":6,"parameters":""},{"name":"Mouse Move","code":"//This is triggered when the mouse moves.","special":7,"parameters":""},{"name":"Game Close","code":"//This activates when your game closes.","special":8,"parameters":""},{"name":"RunIntro","code":"//Count will increase 60 frames per second\nClearScreen()\nif introStage = 0 Then\n var progress = 0\n var progressMax = 14\n if ImageIsLoaded(\"Computer\") Then\n progress += 1\n End If\n if ImageIsLoaded(\"Title\") Then\n progress += 1\n End If\n if ImageIsLoaded(\"Sprites\") Then\n progress += 1\n End If\n if ImageIsLoaded(\"Button\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Item\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Ammo\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Shoot\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Door\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Health\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Shoot2\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Dead\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Bomb\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Teleport\") Then\n progress += 1\n End If\n if SoundIsLoaded(\"Gameover\") Then\n progress += 1\n End If\n //Draw Background\n SetFillColor(\"Black\")\n FillRect(0,0,1024,768)\n //Draw Text\n SetFillColor(\"White\")\n context.font = \"60pt Calibri\";\n SetStringAlign(\"center\")\n DrawString(\"Loading...\", 512, 300)\n //Draw Loading Bar\n SetFillColor(\"Red\")\n FillRect(100,668,824*progress/progressMax,40)\n SetStrokeColor(\"Silver\")\n DrawRect(100,668,824,40)\n if progress = progressMax Then\n If introCount >= 40 Then\n introStage = 1\n introCount = 0\n End If\n else\n introCount = 0\n End If\nEnd If\nif introStage = 1 Then\n //Draw the computer\n SetImageDrawOrigin(0,0)\n DrawImage(\"Computer\",0,0)\n if introCount >= 0 Then\n SetFillColor(\"rgb(0,255,0)\")\n context.font = \"15pt Calibri\";\n SetStringAlign(\"left\")\n DrawString(\"/STARTUP.TRNS\", 260, 180)\n End If\n if introCount >= 60 Then\n var text = \"\"\n if introCount >= 100 Then\n text += \".\"\n End If\n if introCount >= 140 Then\n text += \".\"\n End If\n if introCount >= 180 Then\n text += \".\"\n End If\n if introCount >= 220 Then\n text += \".\"\n End If\n if introCount >= 260 Then\n text += \".\"\n End If\n DrawString(text, 260, 200)\n End If\n if introCount >= 300 Then\n SetFillColor(\"rgb(255,0,0)\")\n DrawString(\"_WARNING_\", 260, 220)\n End If\n if introCount >= 320 Then\n DrawString(\"DOWNLOADING DATA...\", 260, 240)\n End If\n if introCount >= 360 Then\n DrawString(\"INCOMING TRANSMISSION...\", 260, 260)\n End If\n if introCount >= 400 Then\n DrawString(\"'SPACE STATION EQWANOX HAS BEEN SEVERELY DAMAGED\", 260, 300)\n DrawString(\"IN NEED OF EMERGENCY EVAC.'\", 260, 320)\n End If\n if introCount >= 550 Then\n DrawString(\"SENT AT 5:47 4/5/2130\", 260, 340)\n End If\n if introCount >= 700 Then\n var color = ((100-(800-introCount))/100)\n SetFillColor(\"rgba(0,0,0,\"+color+\")\")\n FillRect(0,0,1024,768)\n End If\n if introCount >= 800 Then\n introStage += 1\n introCount = 0\n End If\nEnd If\nif introStage = 2 Then\n //Draw Title Screen With Button\n SetImageDrawOrigin(0,0)\n DrawImage(\"Title\",0,0)\n SetImageDrawOrigin(0.5,0.5)\n DrawImage(\"Button\",512,500)\n SetFillColor(\"White\")\n context.font = \"20pt Calibri\";\n SetStringAlign(\"center\")\n DrawString(\"Play\", 512, 510)\n\n if introCount <= 100 Then\n var color = ((100-introCount)/100)\n SetFillColor(\"rgba(0,0,0,\"+color+\")\")\n FillRect(0,0,1024,768)\n End If\n if introCount >= 101 Then\n introTimer.Stop()\n introCount = 0\n End If\nEnd If\nintroCount += 1","special":0,"parameters":""},{"name":"LoadLevel","code":"currentScreen = GameScreen\nif gameProgress = 0 Then\n //Create a new level using the level 1 data\n var spawntimer = 5 //time between enemy spawning\n var enemylimit = 60 //enemies per level\n var maxenemy = 10 //maximum amount of enemies on-screen\n var grid = new Array()\n grid[0] = \"9xyzxaaaaaaaaaaaaaxzyx9\"\n grid[1] = \"xxyzaa11111111111aazyxx\"\n grid[2] = \"yyyaa1000000000001aayyy\"\n grid[3] = \"zzaa100000000000001aazz\"\n grid[4] = \"xxa10001110001110001axx\"\n grid[5] = \"zza1001gbF101Fbg1001azz\"\n grid[6] = \"yya1001daaa0aaad1001ayy\"\n grid[7] = \"xxa1001Kah101haU1001axx\"\n grid[8] = \"6xaT000111000111000Rax6\"\n grid[9] = \"xxa10000000000000001axx\"\n grid[10] = \"yya1001aa00000aa1001ayy\"\n grid[11] = \"zza10001aaaaaaa10001azz\"\n grid[12] = \"xxa10000111111100001axx\"\n grid[13] = \"zzaa1000000p0000001aazz\"\n grid[14] = \"yyyaa1000000000001aayyy\"\n grid[15] = \"xxyzaa11111111111aazyxx\"\n grid[16] = \"9xyzxaaaaaaaaaaaaaxzyx9\"\n\n level = new Level(spawntimer, enemylimit, maxenemy, grid)\nEnd If","special":0,"parameters":""}],"permanent":true,"special":1},{"name":"Level","methods":[{"name":"On Construction","code":"this.badGuys = new Array()\n\nthis.player = new Character(this, \"player\")\n\nthis.spawnTimer = spawntimer\nthis.enemyLimit = enemylimit\nthis.maxEnemy = maxenemy\n\n//Now cycle through the grid and put it into 2D array form - Width 23, Height 17\nthis.grid = new Array()\nfor x = 0 to 22\n this.grid[x] = new Array()\n for y = 0 to 16\n this.grid[x][y] = grid[y].charAt(x)\n next\nnext\n\n\n//Go through grid and determine player location, create baddies\nfor x = 0 to 22\n for y = 0 to 16\n if this.grid[x][y] = \"p\" Then\n this.player.x = x*44+22\n this.player.y = y*44+22\n End If\n if this.grid[x][y] = \"x\" Then\n var c = new Character(this, \"green\")\n c.x = x*44+22\n c.y = y*44+22\n this.badGuys.push(c)\n End If\n if this.grid[x][y] = \"y\" Then\n var c = new Character(this, \"blue\")\n c.x = x*44+22\n c.y = y*44+22\n this.badGuys.push(c)\n End If\n if this.grid[x][y] = \"z\" Then\n var c = new Character(this, \"red\")\n c.x = x*44+22\n c.y = y*44+22\n this.badGuys.push(c)\n End If\n if this.grid[x][y] = \"6\" Then\n var c = new Character(this, \"boss\")\n c.x = x*44+22\n c.y = y*44+22\n this.badGuys.push(c)\n End If\n next\nnext\n\n//Now set up the logic and draw timer\nthis.timer = new Timer(\"LogicAndDraw()\", 1.0/30.0, this)","special":1,"parameters":"spawntimer, enemylimit, maxenemy, grid"},{"name":"LogicAndDraw","code":"//Logic\n\n//Move player\nvar moveX = 0\nvar moveY = 0\nIf KeyIsPressed(37) Then\n moveX -= 1\nEnd If\nIf KeyIsPressed(39) Then\n moveX += 1\nEnd If\nIf KeyIsPressed(38) Then\n moveY -= 1\nEnd If\nIf KeyIsPressed(40) Then\n moveY += 1\nEnd If\nthis.player.Run(moveX, moveY)\n\n//Move all the characters\nfor i = 0 to this.badGuys.length-1\n this.badGuys[i].RunAI()\nnext\n\n//Draw\nClearScreen()\n\n//Now loop through all the tiles and draw them\nSetImageDrawOrigin(0,0)\n for x = 0 to 22\n for y = 0 to 16\n if this.grid[x][y] = \"1\" Then\n DrawImageSection(\"Sprites\", 220, 110, 44, 44, x*44, y*44, 44, 44, 0)\n else\n DrawImageSection(\"Sprites\", 220, 0, 44, 44, x*44, y*44, 44, 44, 0)\n End If\n next\n next\n\n//Draw player\nthis.player.Draw()\n\n//Draw the baddies\nfor i = 0 to this.badGuys.length - 1\n this.badGuys[i].Draw()\nnext","special":0,"parameters":""}],"permanent":false,"special":0},{"name":"Character","methods":[{"name":"On Construction","code":"this.type = type\nif type = \"player\" Then\n this.health = 100\n this.maxHealth = 100\n this.x = 0\n this.y = 0\n this.direction = \"down\"\n this.speed = 13/5\n this.spriteSheetX = 0\n this.spriteSheetY = 0\n this.spriteSheetWidth = 55\n this.spriteSheetHeight = 55\nEnd If\nif type = \"green\" Then\n this.health = 100\n this.maxHealth = 100\n this.x = 0\n this.y = 0\n this.direction = \"down\"\n this.speed = 5/5\n this.spriteSheetX = 330\n this.spriteSheetY = 0\n this.spriteSheetWidth = 55\n this.spriteSheetHeight = 55\nEnd If\nif type = \"blue\" Then\n this.health = 100\n this.maxHealth = 100\n this.x = 0\n this.y = 0\n this.direction = \"down\"\n this.speed = 8/5\n this.spriteSheetX = 385\n this.spriteSheetY = 0\n this.spriteSheetWidth = 55\n this.spriteSheetHeight = 55\nEnd If\nif type = \"red\" Then\n this.health = 100\n this.maxHealth = 100\n this.x = 0\n this.y = 0\n this.direction = \"down\"\n this.speed = 12/5\n this.spriteSheetX = 440\n this.spriteSheetY = 0\n this.spriteSheetWidth = 55\n this.spriteSheetHeight = 55\nEnd If\nif type = \"boss\" Then\n this.health = 100\n this.maxHealth = 100\n this.x = 0\n this.y = 0\n this.direction = \"down\"\n this.speed = 8/5\n this.spriteSheetX = 495\n this.spriteSheetY = 0\n this.spriteSheetWidth = 110\n this.spriteSheetHeight = 110\nEnd If\n\n\nthis.level = level","special":1,"parameters":"level, type"},{"name":"Draw","code":"IF this.direction=\"up\" then this.rotation=180\nIF this.direction=\"down\" then this.rotation=0\nIF this.direction=\"left\" then this.rotation=90\nIF this.direction=\"right\" then this.rotation=270\nIF this.direction=\"leftup\" then this.rotation=180-45\nIF this.direction=\"rightup\" then this.rotation=180+45\nIF this.direction=\"leftdown\" then this.rotation=45\nIF this.direction=\"rightdown\" then this.rotation=-45\n\nSetImageDrawOrigin(0.5,0.5)\nDrawImageSection(\"Sprites\", this.spriteSheetX, this.spriteSheetY, this.spriteSheetWidth,this.spriteSheetHeight, this.x, this.y, this.spriteSheetWidth, this.spriteSheetHeight, this.rotation)","special":0,"parameters":""},{"name":"Run","code":"//Do collision code here\n\nif moveX = 1 Then this.direction = \"right\"\nif moveX = -1 Then this.direction = \"left\"\nif moveY = 1 Then this.direction = \"down\"\nif moveY = -1 Then this.direction = \"up\"\n\nif moveY = 1 and moveX = 1 Then this.direction = \"rightdown\"\nif moveY = -1 and moveX = 1 Then this.direction = \"rightup\"\nif moveY = 1 and moveX = -1 Then this.direction = \"leftdown\"\nif moveY = -1 and moveX = -1 Then this.direction = \"leftup\"\n\n//Get the player's approximate new tile\nvar newX = (this.x + moveX*this.speed)\nvar newY = (this.y + moveY*this.speed)\nvar tileX = Round(newX/44)\nvar tileY = Round(newY/44)\n\n//Now loop through a 3x3 tile radius with the player's tile in the middle and detect if the player's too close\nfor x = tileX - 1 to tileX + 1\n for y = tileY - 1 to tileY + 1\n if x >= 0 and y >= 0 and x < 23 and y < 23 and level.grid[x][y] = \"1\" Then\n var padX = this.spriteSheetWidth-15\n var padY = this.spriteSheetHeight-15\n var lb = (x*44+22)-padX, rb = (x*44+22)+padY, ub = (y*44+22)-padX, db = (y*44+22)+padY\n if newX > lb and newX < rb and newY > ub and newY < db Then\n if newX > lb and newX < rb and this.y > ub and this.y < db Then \n moveX = 0\n end if\n if newY > ub and newY < db and this.x > lb and this.x < rb Then\n moveY = 0\n End If\n End If\n End If\n next\nnext\nif newX < 22 Then newX = 22\nif newY < 22 Then newY = 22\nif newX > 23*44-22 Then newX = 23*44-22\nif newY > 15*44-22 Then newY = 15*44-22\nif moveX != 0 Then this.x = newX\nif moveY != 0 Then this.y = newY","special":0,"parameters":"moveX, moveY"},{"name":"RunAI","code":"var moveX = 0\nvar moveY = 0\nif level.player.x < this.x-10 Then moveX = -1\nif level.player.x > this.x+10 Then moveX = 1\nif level.player.y < this.y-10 Then moveY = -1\nif level.player.y > this.y+10 Then moveY = 1\nthis.Run(moveX, moveY)","special":0,"parameters":""}],"permanent":false,"special":0}],[{"name":"Button","source":"http://www.gamemakersgarage.com/RetroGame/button.jpg","isImage":true},{"name":"Computer","source":"http://www.gamemakersgarage.com/RetroGame/compter.jpg","isImage":true},{"name":"Sprites","source":"http://www.gamemakersgarage.com/RetroGame/sprites.png","isImage":true},{"name":"Title","source":"http://www.gamemakersgarage.com/RetroGame/title.jpg","isImage":true},{"name":"Item","source":"http://www.gamemakersgarage.com/RetroGame/item.mp3","isImage":false},{"name":"Ammo","source":"http://www.gamemakersgarage.com/RetroGame/ammo.mp3","isImage":false},{"name":"Shoot","source":"http://www.gamemakersgarage.com/RetroGame/shoot.mp3","isImage":false},{"name":"Door","source":"http://www.gamemakersgarage.com/RetroGame/door.mp3","isImage":false},{"name":"Health","source":"http://www.gamemakersgarage.com/RetroGame/health.mp3","isImage":false},{"name":"Shoot2","source":"http://www.gamemakersgarage.com/RetroGame/shoot2.mp3","isImage":false},{"name":"Dead","source":"http://www.gamemakersgarage.com/RetroGame/dead.mp3","isImage":false},{"name":"Bomb","source":"http://www.gamemakersgarage.com/RetroGame/bomb.mp3","isImage":false},{"name":"Teleport","source":"http://www.gamemakersgarage.com/RetroGame/teleport.mp3","isImage":false},{"name":"Gameover","source":"http://www.gamemakersgarage.com/RetroGame/gameover.mp3","isImage":false}]]
I actually didn't convert the code, I did just re-made it from how the game looked.
If one of you guys could re-do my movement code, that'd be fantastic cause it's not as awesome as the original movement.
Edit: If it looks slow, that's just because we need to up the movement speed of the player and bad guys.