-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImages.js
29 lines (29 loc) · 9.33 KB
/
Images.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var canvas = document.querySelector("canvas");
canvas.width = window.innerWidth - 2*8;
canvas.height = window.innerHeight - 2*8;
var c = canvas.getContext("2d");
function img(src,angle, flip){//Loads Images
var temp = document.createElement("img")
temp.src = src;
return temp;
}
var stdSize = 32//change to scale elements
let IMAGEDICT={//Dictionary of available images
"idle": img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAABaCAYAAAAYRB7/AAAETklEQVR4nN3bzU4bMRAA4HmnPgLH9tYzoSe49kLfoTSHwqHPUFAllEN7IJS+BQKJQ6UeUClICUqRSKimh2Rd/8x4x1577dSSJcIum/l2/EfWAchbUKtrXxQGj3a6oqq4KQrT1A5BVZHpJeh61BX178a83SiKMkCgZSswKDPTPaKQqng9Qrw+frIDEwZl9MMiqCVgROLs4ARBuZhSmWpgqh7tIB5uz4BG+q9FgQr0KXJQsCv4YeRIWRIFIEB5cNzQXxwFThABOMnvi45+ITBmyC+CIobvkbj5CZulM0flRK0gx0+pMD6YDsqFSpoZUV9bQXKhegE5VctSalRnEFAdvwUDWoY0UBIUvWKwgEB17liQnqG9jTmY/SxJoUc5Yq2n7q6WySiQlqnUGBZnQ+wmYqODM1diOcSBdJQvcOMahVEhd7i1yXnP6wEl7xcaKmRENM7PvHJQIDwdzvHmEvHmMnq++b35zKlO/+pj5QAAiOMhKlAGlDOEZ105jIcuCLETTDQvZQPdnpsYu2bCpF41KBTeniM+zmjMz8tZUhSNydiXcmcq4xKoFddWYzDEdaoq4fDCHx2nKv8dypeptcNJml/1faspKsDJ2RY+fHzprOj143aFCnFmsHcHOLk7IDMyuTsgUTXCDIyOon5WtWIYHbAExQChBhQVNFhY+7gPBoWzpYKlUCGva4F5MxGNKgzz9h/f65A+1ifMG6QEQF2jJIwNsnUgiPmbzDA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ZOOwAAAABJRU5ErkJggg=="),
"1" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAoElEQVQ4jc1OMQ4DIQzzl25kZbyRkZWRb/CM/pUO11TBgqA7qNTBiu0YE5wH6k5Ai0izt5tp6BLmM81HRCnciW9hcvNwcnYuuU+hBCWsteXzR8mhovd4Bf9VmP2kMPs2xLynuRRs6NCoxDoC1s98heUJx6jgKX5fWEI72bd2JaCihNbQ0A9GOdbgklXglS/Cs+fpKWAfvFjlyP4id6eA/TcIXJt7yNRK7wAAAABJRU5ErkJggg=="),
"2" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKUlEQVQ4jWOYl2j/n5qYYV6i/f9OL3Wq4FEDRw0cNXDUwFEDaW0gNTEAMNApbmAeWQcAAAAASUVORK5CYII="),
"3" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKUlEQVQ4jWPomuX2n5qYoWuW2//2he5UwaMGjho4auCogaMG0tpAamIASCDKkhoXsfkAAAAASUVORK5CYII="),
"4" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA8ElEQVQ4jaXTOw7DIBAE0L3Slm4pKSnduvQ1OAZnypVIEcYMC5jEQUIGyXrM8hFJmuXlsqDxeDRfNoBJe+hnrIAxSG6SPoJKA3ahSPo0YQySuf+dNAbJp5M2oU2H+TcLnO4Dnq6W3pXPaVcog4zdoivw2CrKMFIPy53hx9aCDMUg9Y7aezprwPDldA28elFcMsAlbl/U6KCOTfKuFdx1vMBVNl+tuz0EajHMYyB49vZFRGw6C3NiSXr9O31RXivEOCe1VTRbYK8UQF/6Tl9exGIdzKBFvcFmVXSHxaDFZjjSImVzSEnzEJzhGNst8FrhNxt+sB1ahZtPAAAAAElFTkSuQmCC"),
"5" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKUlEQVQ4jWPQrXP5T03MoFvn8t92WjBV8KiBowaOGjhq4KiBtDaQmhgAiclJqi2baEkAAAAASUVORK5CYII="),
"6" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAy0lEQVQ4ja3SsQ7CMAwE0PuljF0zMmb02jG/kf8OQ3rUuI5LSyNZQKie7gx4JfRoxLlbl3G/LmP4nCR0eIBF9J0GNCwJvWYFSpDIwhbiewA4JJwBOhWH39e8YQS9it5nm65m9FYUBgCzimIgcRJ+auoT7cgm0vNV8wys+Qi1skNTjJWjSq3siLsze+ySbS0inBAjqIFZup8wALCIhi9jBL1kfL2E6YReqssYMHaoMULhX+MsIaFbO5uBj2AAwGR/1bTg7R9gBj6SbDtvngttiXS5xLMAAAAASUVORK5CYII="),
"7" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKUlEQVQ4jWMoc6/7T03MUOZe97/eoZUqeNTAUQNHDRw1cNRAWhtITQwAUlGGMvc8UIoAAAAASUVORK5CYII="),
"8" : img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAH6klEQVR4nO3WIZoUZxiF0ZZsI0uIzHpYRmyWgY1ERmKRbKkj8hAwwMDM9FtV94jjX6b6/y63N+9vdwDgsW5/v7/fAYDHMsAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQuL37cL8/Sv2PBYCjeOgAX1X9EQE4HwPMd9U/UICrMsBMqh8egAGGi6mPCvA0Bhg4jfpgwksywACxeggwwABcTD1yR2aAAeAnGWAAOCkDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDAABAwwAAQMMAAEDDACB258f73c21D82AL4wwAAnUo8GBhgATs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oDAGBRHgAAi/IAAFiUBwDAojwAABblAQCwKA8AgEV5AAAsygMAYFEeAACL8gAAWJQHAMCiPAAAFuUBALAoDwCARXkAACzKAwBgUR4AAIvyAAAY9C9kjCw+rNgFzQAAAABJRU5ErkJggg=="),
"DoorClosed" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAAAqElEQVRIie3VwQ3AIAgFUMdwBdfpTN3VMX5PXjDkQwrSQw9csD4TAqUBHUDHfbWQWF5Lg2VCe4jl5fk5+G0JzsHbh3MAc6gX5bmMfJiVwnueD7M20sJf4yjYOgDWAcqHvSVh9/LhbQAUiOXrYetA1MMbRH4634EXKKMeZiDLqwOSBntXD1td+TAL9pC5xmHw38d1fWyF3X0cBrMHNPAcbF3n1gFZXhr8ACgL2YotMpinAAAAAElFTkSuQmCC"),
"DoorOpen" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAoCAYAAADkDTpVAAABMUlEQVRIidXWvYpDIRAFYNPYWFmZxkosrCxE8gpCikCeKe+aKs9wttlhYS4y5kf3ppgiN+F8cK6MUbVW1FqRc0bOGSklpJQQQkAIAd57eO/hnINzDtZaWGthjIExBlpraK2h1AFKHXC7KtyuCsARwBHqawAeTJ/3D1DQ9wE8EPcE3NMG3B8gVfJ2RdOAXjCflyt6G2itobUmAlJwt6JpAAXzebYi/v164HFWeJzVBpIqkp6vAy4nhcvpDyiloJTSBUYrmw/QMSWAgvl0VwNbcv8H8EB66T2AgvcD0LKjQF7Z5qXy4NELZzpAy46AGCNijPIxpbpGL5zpAAVzQKpquKLpAK3rXkUvH9OPA/S3m2b40h89pssBGvHS7wBiRcsAGgl4+iUvB2ikFbF5/vv76cAP/b0s1prwFOUAAAAASUVORK5CYII="),
"key" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAYAAADwdn+XAAAAOklEQVQokWNggIL//xn+I2MGUgC6ZpIMwaYBl4FYLcFlG9UMwCaOIk/ICwQNIDUQsRqAzRB8gY6sHgCFjcs1TMDauwAAAABJRU5ErkJggg=="),
"UI" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAAoCAYAAAAmGCn4AAABoElEQVR4nO3bQW6DMBAFUJ+v1+k9c4RsewSWdFFZIsNYOCpokugtnsRgI8Hqwxi3n1tbv7/+bI/VarVarVZfV7dsAAC4Rs/cFk92cWI2BwB4FLMzjnVtFLQAwLm2WbsL4J9bW9flvgvk6jcKAHhlo8DdZup23i6A+8R1ue8mAwDHZjK1ZRfFtF6XOwAwKWZo9jG7C+BRIAMAc2a6x+lPWLGnXf0gAPBOsiw9bEF31TcPAJ/g8As4WzgGAP4nfvkOW9ACGADOk2WsAAaAiwlgAChwGMDWgAHgfIdrwAIYAM7nJywAKKAFDQAFtKABoIAWNAAUsA0JAApYAwaAAtaAAaCANWAAKKAFDQAFtKABoIAWNAAUsA0JAAoIYAAo4CcsACgw/RNWV33DAPAJRjm7a0H3404YA8Bzsiw9bEFnLenqBwGAd5K1nKf2AW8vFsAA8JyYoVP7gPvEdRkvHAMAYzOZmm5DytJ628sGAB6Ngjh+EQ8DGAC4RhrAfSAmeQzm6jcMAHhlMTvj2EMAx5MAwDV65raY0tkktVqtVqvV59a/RXVSsGn9P1kAAAAASUVORK5CYII="),
"heart" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAdklEQVQ4jdXTQQ6AIAxE0R6D+x/I67jElaEdU5iBbjTpys+DBDWD5zLr7+A7pfmE2QKmCeHdxuACpklDv8B3WRPQLPTxbNOw8Sr0KNNMT6fOj8AKNNx0FUh9h/LpTlH599vGVJTCWFTCVugWlqFHGKIlGKJM+wBT2hinzYe/ggAAAABJRU5ErkJggg=="),
"half-heart" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAUCAYAAAC9BQwsAAAAW0lEQVQ4jWNgQAPnGBj+wzC6HE6ArIlozTCF3yUQmKBmbJqQNePViE0Tsq0YBuCzDa+TCWnC6WxSNKJoJlUjXDMxfqTYuWSHLHUTwTDUTFZWoyhzE60RWTOyGADjUEe10vX2GwAAAABJRU5ErkJggg=="),
"sign" :img("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAATUlEQVQ4jWM41sPwn5qYgSYGcjAgBDgYMPnoNC41KAbiMhTdAEIW0N7L+LxKSC1WL2PzIil8BkpdhC5GmzCkqoGEAMkaRg0cNXA4GggAS+nvahasOxYAAAAASUVORK5CYII=")
};