Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function loadMap(){
- var newMap=document.getElementById('map').value
- var loopLimit = document.getElementById('map').value.length
- var wesIsDumb
- var x = 0
- var y = 0
- var test = []
- var theMap = [];
- clearMap(lastX,lastY)
- for(wesIsDumb=0;wesIsDumb<=loopLimit;wesIsDumb++){
- var sneetch = newMap.substring(wesIsDumb,wesIsDumb+1)
- if(sneetch == '\n'){
- y++
- x=0
- }
- else if(sneetch == ''){}
- else{
- var tile = reverseConvert(sneetch)
- var xLocation = 16*x+250;
- var yLocation = -16*y+640
- createDiv(x, y)
- theMap.push(test)
- theMap[x][y] = sneetch
- document.getElementById('x'+x+'y'+y).innerHTML += "<img id='imgx"+x+'y'+y+"'src='./images/"+tile+".gif' style='position:absolute; bottom:"+yLocation+"px; left:"+xLocation+"px;' onmousedown='editTile("+x+'y'+y+")' onmouseover='editTileOver("+x+'y'+y+")' onmouseup='cursorUp()'>";
- lastX=x
- lastY=y
- x++
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement