271 lines
50 KiB
JavaScript
Executable File
271 lines
50 KiB
JavaScript
Executable File
if(typeof module !== "undefined") {
|
|
module.exports = ebsprite;
|
|
} else {
|
|
this.ebsprite = ebsprite;
|
|
}
|
|
|
|
var spriteData = [{"name":"Ness","sprites":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16"]},{"name":"Paula","sprites":["17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32"]},{"name":"Jeff","sprites":["33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48"]},{"name":"Poo","sprites":["49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64"]},{"name":"Robot Ness","sprites":["65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80"]},{"name":"Ness in pajamas","sprites":["81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96"]},{"name":"Ness on bicycle","sprites":["97","98","99","100","101","102","103","104","105","106","107","108","109","110","111","112"]},{"name":"Ness angel","sprites":["113","114","115","116","117","118","119","120","121","122","123","124","125","126","127","128"]},{"name":"Paula angel","sprites":["129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144"]},{"name":"Jeff angel","sprites":["145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160"]},{"name":"Poo angel","sprites":["161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176"]},{"name":"Diamondized person","sprites":["177","178","179","180","181","182","183","184","185","186","187","188","189","190","191","192"]},{"name":"Charred person","sprites":["193","194","195","196","197","198","199","200","201","202","203","204","205","206","207","208"]},{"name":"Ness doing peace sign","sprites":["209","210","211","212","213","214","215","216"]},{"name":"Jeff in bed","sprites":["217","218","219","220","221","222","223","224"]},{"name":"Ness lying down","sprites":["225","226","227","228","229","230","231","232"]},{"name":"Ness climbing","sprites":["233","234","235","236","237","238","239","240"]},{"name":"Paula climbing","sprites":["241","242","243","244","245","246","247","248"]},{"name":"Jeff climbing","sprites":["249","250","251","252","253","254","255","256"]},{"name":"Poo climbing","sprites":["257","258","259","260","261","262","263","264"]},{"name":"Ness climbing down","sprites":["265","266","267","268","269","270","271","272"]},{"name":"Paula climbing down","sprites":["273","274","275","276","277","278","279","280"]},{"name":"Jeff climbing down","sprites":["281","282","283","284","285","286","287","288"]},{"name":"Poo climbing down","sprites":["289","290","291","292","293","294","295","296"]},{"name":"Robot","sprites":["297","298","299","300","301","302","303","304","305","306","307","308","309","310","311","312"]},{"name":"Robot on the ground","sprites":["313","314","315","316","317","318","319","320"]},{"name":"Li'l Ness","sprites":["321","322","323","324","325","326","327","328","329","330","331","332","333","334","335","336"]},{"name":"Li'l Paula","sprites":["337","338","339","340","341","342","343","344","345","346","347","348","349","350","351","352"]},{"name":"Li'l Jeff","sprites":["353","354","355","356","357","358","359","360","361","362","363","364","365","366","367","368"]},{"name":"Li'l Poo","sprites":["369","370","371","372","373","374","375","376","377","378","379","380","381","382","383","384"]},{"name":"Li'l Escargo Express Guy","sprites":["385","386","387","388","389","390","391","392"]},{"name":"Li'l Mach Pizza Guy","sprites":["393","394","395","396","397","398","399","400"]},{"name":"Li'l gift box","sprites":["401","402","403","404","405","406","407","408"]},{"name":"Li'l angel","sprites":["409","410","411","412","413","414","415","416","417","418","419","420","421","422","423","424"]},{"name":"Li'l teddy bear","sprites":["425","426","427","428","429","430","431","432","433","434","435","436","437","438","439","440"]},{"name":"Li'l diamondized guy","sprites":["441","442","443","444","445","446","447","448","449","450","451","452","453","454","455","456"]},{"name":"Li'l charred guy","sprites":["457","458","459","460","461","462","463","464","465","466","467","468","469","470","471","472"]},{"name":"Li'l Ness doing peace sign","sprites":["473","474","475","476","477","478","479","480"]},{"name":"Flying Man","sprites":["481","482","483","484","485","486","487","488","489","490","491","492","493","494","495","496"]},{"name":"King","sprites":["497","498","499","500","501","502","503","504","505","506","507","508","509","510","511","512"]},{"name":"Brick Road","sprites":["513","514","515","516","517","518","519","520","521","522","523","524","525","526","527","528"]},{"name":"King climbing up","sprites":["529","530","531","532","533","534","535","536"]},{"name":"King climbing down","sprites":["537","538","539","540","541","542","543","544"]},{"name":"Pokey","sprites":["545","546","547","548","549","550","551","552","553","554","555","556","557","558","559","560"]},{"name":"Picky","sprites":["561","562","563","564","565","566","567","568","569","570","571","572","573","574","575","576"]},{"name":"Bubble Monkey","sprites":["577","578","579","580","581","582","583","584","585","586","587","588","589","590","591","592"]},{"name":"Bubble Monkey climbing up","sprites":["593","594","595","596","597","598","599","600","601","602","603","604","605","606","607","608"]},{"name":"Pokey in his suit","sprites":["609","610","611","612","613","614","615","616","617","618","619","620","621","622","623","624"]},{"name":"B. Monkey and li'l bubble","sprites":["625","626","627","628","629","630","631","632"]},{"name":"B. Monkey, floating","sprites":["633","634","635","636","637","638","639","640"]},{"name":"Teddy bear","sprites":["641","642","643","644","645","646","647","648","649","650","651","652","653","654","655","656"]},{"name":"Old guy with cane","sprites":["657","658","659","660","661","662","663","664"]},{"name":"Old lady with cane","sprites":["665","666","667","668","669","670","671","672"]},{"name":"Old fat guy with hat","sprites":["673","674","675","676","677","678","679","680"]},{"name":"Guy in blue clothes","sprites":["681","682","683","684","685","686","687","688"]},{"name":"Sorta bald guy in suit","sprites":["689","690","691","692","693","694","695","696"]},{"name":"Brunette shopping lady","sprites":["697","698","699","700","701","702","703","704"]},{"name":"Blonde shopping lady","sprites":["705","706","707","708","709","710","711","712"]},{"name":"Fat guy in red suit","sprites":["713","714","715","716","717","718","719","720"]},{"name":"Drinking guy","sprites":["721","722","723","724","725","726","727","728"]},{"name":"Blonde guy in a suit","sprites":["729","730","731","732","733","734","735","736"]},{"name":"Dark-haired guy in a suit","sprites":["737","738","739","740","741","742","743","744"]},{"name":"Sneaky guy with a hat","sprites":["745","746","747","748","749","750","751","752"]},{"name":"Nerdy red-haired guy","sprites":["753","754","755","756","757","758","759","760"]},{"name":"Blonde lady w/ blue dress","sprites":["761","762","763","764","765","766","767","768"]},{"name":"Blonde lady w/ red dress","sprites":["769","770","771","772","773","774","775","776"]},{"name":"Elevator lady","sprites":["777","778","779","780","781","782","783","784"]},{"name":"Blonde happy lady","sprites":["785","786","787","788","789","790","791","792"]},{"name":"Unassuming local guy","sprites":["793","794","795","796","797","798","799","800"]},{"name":"Young blonde guy in blue","sprites":["801","802","803","804","805","806","807","808"]},{"name":"Surfer","sprites":["809","810","811","812","813","814","815","816"]},{"name":"Beach lady","sprites":["817","818","819","820","821","822","823","824"]},{"name":"Hotel attendant","sprites":["825","826","827","828","829","830","831","832"]},{"name":"Cop in sunglasses","sprites":["833","834","835","836","837","838","839","840"]},{"name":"Captain Strong","sprites":["841","842","843","844","845","846","847","848"]},{"name":"Travelling entertainer","sprites":["849","850","851","852","853","854","855","856"]},{"name":"Trumpet person","sprites":["857","858","859","860","861","862","863","864"]},{"name":"Jamaican guy","sprites":["865","866","867","868","869","870","871","872"]},{"name":"Mr. T","sprites":["873","874","875","876","877","878","879","880"]},{"name":"Guy in swimming suit","sprites":["881","882","883","884","885","886","887","888"]},{"name":"Girl in bikini","sprites":["889","890","891","892","893","894","895","896"]},{"name":"Bus driver head","sprites":["897","898","899","900","901","902","903","904"]},{"name":"Tessie watcher","sprites":["905","906","907","908","909","910","911","912"]},{"name":"Jackie","sprites":["913","914","915","916","917","918","919","920"]},{"name":"Punk guy","sprites":["921","922","923","924","925","926","927","928"]},{"name":"Weirdo guy in swim trunks","sprites":["929","930","931","932","933","934","935","936"]},{"name":"Zombie lady","sprites":["937","938","939","940","941","942","943","944"]},{"name":"Dalaamese servant","sprites":["945","946","947","948","949","950","951","952"]},{"name":"Chinese girl","sprites":["953","954","955","956","957","958","959","960"]},{"name":"Ship captain","sprites":["961","962","963","964","965","966","967","968"]},{"name":"Ship crewman","sprites":["969","970","971","972","973","974","975","976"]},{"name":"Lady in veil","sprites":["977","978","979","980","981","982","983","984"]},{"name":"Happy turban guy","sprites":["985","986","987","988","989","990","991","992"]},{"name":"Big nose Arab guy","sprites":["993","994","995","996","997","998","999","1000"]},{"name":"Mustache Arab turban guy","sprites":["1001","1002","1003","1004","1005","1006","1007","1008"]},{"name":"Arab Mr. T","sprites":["1009","1010","1011","1012","1013","1014","1015","1016"]},{"name":"Tenda","sprites":["1017","1018","1019","1020","1021","1022","1023","1024","1025"]},{"name":"Star Master guy","sprites":["1026","1027","1028","1029","1030","1031","1032","1033"]},{"name":"Weird horned guy","sprites":["1034","1035","1036","1037","1038","1039","1040","1041"]},{"name":"Flower","sprites":["1042","1043","1044","1045","1046","1047","1048","1049"]},{"name":"Insane Cultist","sprites":["1050","1051","1052","1053","1054","1055","1056","1057"]},{"name":"Tribal warrior","sprites":["1058","1059","1060","1061","1062","1063","1064","1065"]},{"name":"Palm tan guy","sprites":["1066","1067","1068","1069","1070","1071","1072","1073"]},{"name":"Sun bathing girl","sprites":["1074","1075","1076","1077","1078","1079","1080","1081"]},{"name":"Chinese monk guy","sprites":["1082","1083","1084","1085","1086","1087","1088","1089"]},{"name":"Invisible","sprites":["1090","1091","1092","1093","1094","1095","1096","1097"]},{"name":"Rabbit","sprites":["1098","1099","1100","1101","1102","1103","1104","1105"]},{"name":"Big smile lady","sprites":["1106","1107","1108","1109","1110","1111","1112","1113"]},{"name":"Bodyguard","sprites":["1114","1115","1116","1117","1118","1119","1120","1121"]},{"name":"Mexican guy","sprites":["1122","1123","1124","1125","1126","1127","1128","1129"]},{"name":"Bus driver","sprites":["1130","1131","1132","1133","1134","1135","1136","1137"]},{"name":"Blonde guy in blue suit","sprites":["1138","1139","1140","1141","1142","1143","1144","1145"]},{"name":"Some brunette kid","sprites":["1146","1147","1148","1149","1150","1151","1152","1153"]},{"name":"\"I love qowga\" shirt guy","sprites":["1154","1155","1156","1157","1158","1159","1160","1161"]},{"name":"Scuzzy guy","sprites":["1162","1163","1164","1165","1166","1167","1168","1169"]},{"name":"Red clothes person","sprites":["1170","1171","1172","1173","1174","1175","1176","1177"]},{"name":"Orange haired nerd kid","sprites":["1178","1179","1180","1181","1182","1183","1184","1185"]},{"name":"Tough guy w/ sunglasses","sprites":["1186","1187","1188","1189","1190","1191","1192","1193"]},{"name":"Shy guy","sprites":["1194","1195","1196","1197","1198","1199","1200","1201"]},{"name":"Pigtail blonde girl","sprites":["1202","1203","1204","1205","1206","1207","1208","1209"]},{"name":"Pigtail dark haired girl","sprites":["1210","1211","1212","1213","1214","1215","1216","1217"]},{"name":"Yellow clothes blonde","sprites":["1218","1219","1220","1221","1222","1223","1224","1225"]},{"name":"Little kid in blue","sprites":["1226","1227","1228","1229","1230","1231","1232","1233"]},{"name":"Kid in baseball helmet","sprites":["1234","1235","1236","1237","1238","1239","1240","1241"]},{"name":"Kid in derby hat","sprites":["1242","1243","1244","1245","1246","1247","1248","1249"]},{"name":"Kid in detective hat","sprites":["1250","1251","1252","1253","1254","1255","1256","1257"]},{"name":"Blonde ponytail girl","sprites":["1258","1259","1260","1261","1262","1263","1264","1265"]},{"name":"Happy girl in red","sprites":["1266","1267","1268","1269","1270","1271","1272","1273"]},{"name":"Chick","sprites":["1274","1275","1276","1277","1278","1279","1280","1281"]},{"name":"Dog","sprites":["1282","1283","1284","1285","1286","1287","1288","1289"]},{"name":"Cat","sprites":["1290","1291","1292","1293","1294","1295","1296","1297"]},{"name":"Bird on perch","sprites":["1298","1299","1300","1301","1302","1303","1304","1305"]},{"name":"Monkey","sprites":["1306","1307","1308","1309","1310","1311","1312","1313"]},{"name":"Blue cow","sprites":["1314","1315","1316","1317","1318","1319","1320","1321"]},{"name":"Escargo Express guy","sprites":["1322","1323","1324","1325","1326","1327","1328","1329"]},{"name":"Hint guy","sprites":["1330","1331","1332","1333","1334","1335","1336","1337"]},{"name":"Baker","sprites":["1338","1339","1340","1341","1342","1343","1344","1345"]},{"name":"Girl in striped apron","sprites":["1346","1347","1348","1349","1350","1351","1352","1353"]},{"name":"Doctor","sprites":["1354","1355","1356","1357","1358","1359","1360","1361"]},{"name":"Nurse","sprites":["1362","1363","1364","1365","1366","1367","1368","1369"]},{"name":"Thick glasses lady","sprites":["1370","1371","1372","1373","1374","1375","1376","1377"]},{"name":"Waitress","sprites":["1378","1379","1380","1381","1382","1383","1384","1385"]},{"name":"Camera guy","sprites":["1386","1387","1388","1389","1390","1391","1392","1393"]},{"name":"Hidden arms dealer","sprites":["1394","1395","1396","1397","1398","1399","1400","1401"]},{"name":"Mom","sprites":["1402","1403","1404","1405","1406","1407","1408","1409"]},{"name":"Tracy","sprites":["1410","1411","1412","1413","1414","1415","1416","1417"]},{"name":"Aloysius Minch","sprites":["1418","1419","1420","1421","1422","1423","1424","1425"]},{"name":"Lardna Minch","sprites":["1426","1427","1428","1429","1430","1431","1432","1433"]},{"name":"Gorgeous","sprites":["1434","1435","1436","1437","1438","1439","1440","1441","1442","1443","1444","1445","1446","1447","1448","1449"]},{"name":"Lucky","sprites":["1450","1451","1452","1453","1454","1455","1456","1457","1458","1459","1460","1461","1462","1463","1464","1465"]},{"name":"Mach Pizza guy","sprites":["1466","1467","1468","1469","1470","1471","1472","1473"]},{"name":"Lier X. Agerate","sprites":["1474","1475","1476","1477","1478","1479","1480","1481"]},{"name":"Frank","sprites":["1482","1483","1484","1485","1486","1487","1488","1489"]},{"name":"Mayor Pirkle","sprites":["1490","1491","1492","1493","1494","1495","1496","1497"]},{"name":"Paula's father","sprites":["1498","1499","1500","1501","1502","1503","1504","1505"]},{"name":"Paula's mother","sprites":["1506","1507","1508","1509","1510","1511","1512","1513"]},{"name":"Everdred","sprites":["1514","1515","1516","1517","1518","1519","1520","1521"]},{"name":"Poochyfud","sprites":["1522","1523","1524","1525","1526","1527","1528","1529"]},{"name":"Mr. Carpainter","sprites":["1530","1531","1532","1533","1534","1535","1536","1537"]},{"name":"Female monkey","sprites":["1538","1539","1540","1541","1542","1543","1544","1545"]},{"name":"Brick Road","sprites":["1546","1547","1548","1549","1550","1551","1552","1553"]},{"name":"Dr. Andonuts","sprites":["1554","1555","1556","1557","1558","1559","1560","1561"]},{"name":"Dalaam girl","sprites":["1562","1563","1564","1565","1566","1567","1568","1569"]},{"name":"Monotoli","sprites":["1570","1571","1572","1573","1574","1575","1576","1577"]},{"name":"Venus","sprites":["1578","1579","1580","1581","1582","1583","1584","1585"]},{"name":"Poo's master","sprites":["1586","1587","1588","1589","1590","1591","1592","1593"]},{"name":"Telephone head guy","sprites":["1594","1595","1596","1597","1598","1599","1600","1601"]},{"name":"Preet proot guy","sprites":["1602","1603","1604","1605","1606","1607","1608","1609"]},{"name":"Star Master flying away","sprites":["1610","1611","1612","1613","1614","1615","1616","1617"]},{"name":"Tenda chief","sprites":["1618","1619","1620","1621","1622","1623","1624","1625"]},{"name":"Mr. Saturn","sprites":["1626","1627","1628","1629","1630","1631","1632","1633"]},{"name":"Miner","sprites":["1634","1635","1636","1637","1638","1639","1640","1641"]},{"name":"Miner's brother","sprites":["1642","1643","1644","1645","1646","1647","1648","1649"]},{"name":"Fourside museum guy","sprites":["1650","1651","1652","1653","1654","1655","1656","1657"]},{"name":"Orange Kid","sprites":["1658","1659","1660","1661","1662","1663","1664","1665"]},{"name":"Apple Kid","sprites":["1666","1667","1668","1669","1670","1671","1672","1673"]},{"name":"Talah Rama","sprites":["1674","1675","1676","1677","1678","1679","1680","1681"]},{"name":"Venus' mother","sprites":["1682","1683","1684","1685","1686","1687","1688","1689"]},{"name":"Brick Road head","sprites":["1690","1691","1692","1693","1694","1695","1696","1697"]},{"name":"Everdred lying down","sprites":["1698","1699","1700","1701","1702","1703","1704","1705"]},{"name":"Magic cake lady","sprites":["1706","1707","1708","1709","1710","1711","1712","1713"]},{"name":"Tony","sprites":["1714","1715","1716","1717","1718","1719","1720","1721","1722","1723","1724","1725","1726","1727","1728","1729"]},{"name":"Tony in bed","sprites":["1730","1731","1732","1733","1734","1735","1736","1737"]},{"name":"Gorgeous dancing","sprites":["1738","1739","1740","1741","1742","1743","1744","1745"]},{"name":"Runaway Five drummer","sprites":["1746","1747","1748","1749","1750","1751","1752","1753"]},{"name":"Runaway Five bass player","sprites":["1754","1755","1756","1757","1758","1759","1760","1761"]},{"name":"Runaway Five sax player","sprites":["1762","1763","1764","1765","1766","1767","1768","1769"]},{"name":"Helpful mole","sprites":["1770","1771","1772","1773","1774","1775","1776","1777"]},{"name":"Healer","sprites":["1778","1779","1780","1781","1782","1783","1784","1785"]},{"name":"Music notes","sprites":["1786","1787","1788","1789","1790","1791","1792","1793"]},{"name":"Pu pu","sprites":["1794","1795","1796","1797","1798","1799","1800","1801"]},{"name":"Zzz","sprites":["1802","1803","1804","1805","1806","1807","1808","1809"]},{"name":"weird white bubble thing","sprites":["1810","1811","1812","1813","1814","1815","1816","1817"]},{"name":"Light bulb","sprites":["1818","1819","1820","1821","1822","1823","1824","1825"]},{"name":"Mystical Record","sprites":["1826","1827","1828","1829","1830","1831","1832","1833"]},{"name":"Weird question mark","sprites":["1834","1835","1836","1837","1838","1839","1840","1841"]},{"name":"Meteor","sprites":["1842","1843","1844","1845","1846","1847","1848","1849"]},{"name":"Bench","sprites":["1850","1851","1852","1853","1854","1855","1856","1857"]},{"name":"Police barrier","sprites":["1858","1859","1860","1861","1862","1863","1864","1865"]},{"name":"Weird tail thing","sprites":["1866","1867","1868","1869","1870","1871","1872","1873"]},{"name":"Streetlight","sprites":["1874","1875","1876","1877","1878","1879","1880","1881"]},{"name":"Bus stop sign","sprites":["1882","1883","1884","1885","1886","1887","1888","1889"]},{"name":"Oval cloud","sprites":["1890","1891","1892","1893","1894","1895","1896","1897"]},{"name":"Street sign","sprites":["1898","1899","1900","1901","1902","1903","1904","1905"]},{"name":"City bus","sprites":["1906","1907","1908","1909","1910","1911","1912","1913","1914","1915","1916","1917","1918","1919","1920","1921"]},{"name":"Real taxi","sprites":["1922","1923","1924","1925","1926","1927","1928","1929","1930","1931","1932","1933","1934","1935","1936","1937"]},{"name":"Delivery truck","sprites":["1938","1939","1940","1941","1942","1943","1944","1945"]},{"name":"White delivery truck","sprites":["1946","1947","1948","1949","1950","1951","1952","1953"]},{"name":"Sky runner","sprites":["1954","1955","1956","1957","1958","1959","1960","1961"]},{"name":"Phase Distorter","sprites":["1962","1963","1964","1965","1966","1967","1968","1969"]},{"name":"Bicycle","sprites":["1970","1971","1972","1973","1974","1975","1976","1977"]},{"name":"Ship","sprites":["1978","1979","1980","1981","1982","1983","1984","1985"]},{"name":"Sign","sprites":["1986","1987","1988","1989","1990","1991","1992","1993"]},{"name":"Trash can","sprites":["1994","1995","1996","1997","1998","1999","2000","2001"]},{"name":"Telephone","sprites":["2002","2003","2004","2005","2006","2007","2008","2009"]},{"name":"Pay phone","sprites":["2010","2011","2012","2013","2014","2015","2016","2017"]},{"name":"Weird think marks","sprites":["2018","2019","2020","2021","2022","2023","2024","2025"]},{"name":"Surprise mark","sprites":["2026","2027","2028","2029","2030","2031","2032","2033"]},{"name":"Sweat","sprites":["2034","2035","2036","2037","2038","2039","2040","2041"]},{"name":"Twinkling stars","sprites":["2042","2043","2044","2045","2046","2047","2048","2049"]},{"name":"Pharaoh casket","sprites":["2050","2051","2052","2053","2054","2055","2056","2057"]},{"name":"sweat","sprites":["2058","2059","2060","2061","2062","2063","2064","2065"]},{"name":"Apple","sprites":["2066","2067","2068","2069","2070","2071","2072","2073"]},{"name":"Bananas","sprites":["2074","2075","2076","2077","2078","2079","2080","2081"]},{"name":"Can","sprites":["2082","2083","2084","2085","2086","2087","2088","2089"]},{"name":"Little mushroom","sprites":["2090","2091","2092","2093","2094","2095","2096","2097"]},{"name":"Mailbox","sprites":["2098","2099","2100","2101","2102","2103","2104","2105"]},{"name":"DON'T ENTER sign","sprites":["2106","2107","2108","2109","2110","2111","2112","2113"]},{"name":"Magic Tart stand","sprites":["2114","2115","2116","2117","2118","2119","2120","2121"]},{"name":"Shadow","sprites":["2122","2123","2124","2125","2126","2127","2128","2129"]},{"name":"Crossroad signs","sprites":["2130","2131","2132","2133","2134","2135","2136","2137"]},{"name":"Exclamation mark","sprites":["2138","2139","2140","2141","2142","2143","2144","2145"]},{"name":"Dalaam present","sprites":["2146","2147","2148","2149","2150","2151","2152","2153"]},{"name":"Jukebox","sprites":["2154","2155","2156","2157","2158","2159","2160","2161"]},{"name":"Slot machine","sprites":["2162","2163","2164","2165","2166","2167","2168","2169"]},{"name":"Pile of bones","sprites":["2170","2171","2172","2173","2174","2175","2176","2177"]},{"name":"Sesame seed","sprites":["2178","2179","2180","2181","2182","2183","2184","2185"]},{"name":"Cross gravestone","sprites":["2194","2195","2196","2197","2198","2199","2200","2201"]},{"name":"Broken phase distorter","sprites":["2202","2203","2204","2205","2206","2207","2208","2209"]},{"name":"Garbage","sprites":["2210","2211","2212","2213","2214","2215","2216","2217"]},{"name":"Star Master's Poof Cloud","sprites":["2218","2219","2220","2221","2222","2223","2224","2225"]},{"name":"Runaway 5 bus","sprites":["2226","2227","2228","2229","2230","2231","2232","2233","2234","2235","2236","2237","2238","2239","2240","2241"]},{"name":"Submarine","sprites":["2242","2243","2244","2245","2246","2247","2248","2249"]},{"name":"Submarine periscope","sprites":["2250","2251","2252","2253","2254","2255","2256","2257"]},{"name":"Broken Mani-Mani statue","sprites":["2258","2259","2260","2261","2262","2263","2264","2265"]},{"name":"Jar of fly honey","sprites":["2274","2275","2276","2277","2278","2279","2280","2281"]},{"name":"Cell door","sprites":["2282","2283","2284","2285","2286","2287","2288","2289"]},{"name":"Coffee Wiggles","sprites":["2290","2291","2292","2293","2294","2295","2296","2297"]},{"name":"Water ripple","sprites":["2298","2299","2300","2301","2302","2303","2304","2305"]},{"name":"Tessie","sprites":["2306","2307","2308","2309","2310","2311","2312","2313"]},{"name":"Drum rim","sprites":["2314","2315","2316","2317","2318","2319","2320","2321"]},{"name":"Big dirt scooper","sprites":["2322","2323","2324","2325","2326","2327","2328","2329"]},{"name":"Guy in cool red car","sprites":["2330","2331","2332","2333","2334","2335","2336","2337"]},{"name":"Flame?","sprites":["2338","2339","2340","2341","2342","2343","2344","2345"]},{"name":"Fountain of Healing","sprites":["2346","2347","2348","2349","2350","2351","2352","2353"]},{"name":"Shiny Enemy Outside","sprites":["2354","2355","2356","2357","2358","2359","2360","2361"]},{"name":"ATM machine","sprites":["2362","2363","2364","2365","2366","2367","2368","2369"]},{"name":"Talking stone","sprites":["2370","2371","2372","2373","2374","2375","2376","2377"]},{"name":"Ship","sprites":["2378","2379","2380","2381","2382","2383","2384","2385"]},{"name":"Casket","sprites":["2386","2387","2388","2389","2390","2391","2392","2393"]},{"name":"Mr. Saturn ball and chain","sprites":["2394","2395","2396","2397","2398","2399","2400","2401"]},{"name":"Mini-ghost","sprites":["2402","2403","2404","2405","2406","2407","2408","2409"]},{"name":"Pencil statue","sprites":["2410","2411","2412","2413","2414","2415","2416","2417"]},{"name":"Tree in pot","sprites":["2418","2419","2420","2421","2422","2423","2424","2425"]},{"name":"Pyramid door","sprites":["2426","2427","2428","2429","2430","2431","2432","2433"]},{"name":"Li'l talking stone","sprites":["2434","2435","2436","2437","2438","2439","2440","2441"]},{"name":"Star","sprites":["2442","2443","2444","2445","2446","2447","2448","2449"]},{"name":"Weird Junk","sprites":["2450","2451","2452","2453","2454","2455","2456","2457"]},{"name":"Boogy Tent eye","sprites":["2458","2459","2460","2461","2462","2463","2464","2465"]},{"name":"Boogy Tent mouth","sprites":["2466","2467","2468","2469","2470","2471","2472","2473"]},{"name":"Microphone","sprites":["2474","2475","2476","2477","2478","2479","2480","2481"]},{"name":"Mr. Batty","sprites":["2482","2483","2484","2485","2486","2487","2488","2489","2490"]},{"name":"Clumsy Robot","sprites":["2491","2492","2493","2494","2495","2496","2497","2498"]},{"name":"Electro Swoosh","sprites":["2499","2500","2501","2502","2503","2504","2505","2506"]},{"name":"French Kiss of Death","sprites":["2507","2508","2509","2510","2511","2512","2513","2514"]},{"name":"Fobby","sprites":["2515","2516","2517","2518","2519","2520","2521","2522"]},{"name":"Robo-pump","sprites":["2523","2524","2525","2526","2527","2528","2529","2530"]},{"name":"Armored Frog","sprites":["2531","2532","2533","2534","2535","2536","2537","2538"]},{"name":"Apple Kid's Mouse","sprites":["2539","2540","2541","2542","2543","2544","2545","2546"]},{"name":"Spiteful Crow","sprites":["2547","2548","2549","2550","2551","2552","2553","2554","2555"]},{"name":"Thirsty Coil Snake","sprites":["2556","2557","2558","2559","2560","2561","2562","2563"]},{"name":"Skate Punk","sprites":["2564","2565","2566","2567","2568","2569","2570","2571"]},{"name":"Stinky Ghost","sprites":["2572","2573","2574","2575","2576","2577","2578","2579","2580"]},{"name":"Handsome Tom","sprites":["2581","2582","2583","2584","2585","2586","2587","2588","2589"]},{"name":"Mad Duck","sprites":["2590","2591","2592","2593","2594","2595","2596","2597"]},{"name":"Manly Fish","sprites":["2598","2599","2600","2601","2602","2603","2604","2605"]},{"name":"Mad Taxi","sprites":["2606","2607","2608","2609","2610","2611","2612","2613"]},{"name":"Demonic Petunia","sprites":["2614","2615","2616","2617","2618","2619","2620","2621"]},{"name":"Ramblin' Evil Mushroom","sprites":["2622","2623","2624","2625","2626","2627","2628","2629","2630"]},{"name":"Ranboob","sprites":["2631","2632","2633","2634","2635","2636","2637","2638"]},{"name":"Evil Mani-Mani","sprites":["2639","2640","2641","2642","2643","2644","2645","2646"]},{"name":"Gruff Goat","sprites":["2647","2648","2649","2650","2651","2652","2653","2654"]},{"name":"Kraken","sprites":["2655","2656","2657","2658","2659","2660","2661","2662"]},{"name":"Crested Booka","sprites":["2663","2664","2665","2666","2667","2668","2669","2670"]},{"name":"Territorial Oak","sprites":["2671","2672","2673","2674","2675","2676","2677","2678"]},{"name":"Wetnosaur","sprites":["2679","2680","2681","2682","2683","2684","2685","2686"]},{"name":"Master Barf","sprites":["2687","2688","2689","2690","2691","2692","2693","2694"]},{"name":"Abstract Art","sprites":["2695","2696","2697","2698","2699","2700","2701","2702"]},{"name":"Zap Eel","sprites":["2703","2704","2705","2706","2707","2708","2709","2710"]},{"name":"Smilin' Sphere","sprites":["2711","2712","2713","2714","2715","2716","2717","2718"]},{"name":"Starman","sprites":["2719","2720","2721","2722","2723","2724","2725","2726"]},{"name":"Li'l UFO","sprites":["2727","2728","2729","2730","2731","2732","2733","2734"]},{"name":"Zombie Possessor","sprites":["2735","2736","2737","2738","2739","2740","2741","2742"]},{"name":"Whirling Robo","sprites":["2743","2744","2745","2746","2747","2748","2749","2750"]},{"name":"Shattered Man","sprites":["2751","2752","2753","2754","2755","2756","2757","2758","2759"]},{"name":"Urban Zombie","sprites":["2760","2761","2762","2763","2764","2765","2766","2767"]},{"name":"Crazed Sign","sprites":["2768","2769","2770","2771","2772","2773","2774","2775","2776"]},{"name":"Sentry Robot","sprites":["2777","2778","2779","2780","2781","2782","2783","2784"]},{"name":"Bad Buffalo","sprites":["2785","2786","2787","2788","2789","2790","2791","2792"]},{"name":"Chomposaur","sprites":["2793","2794","2795","2796","2797","2798","2799","2800"]},{"name":"Gigantic Ant","sprites":["2801","2802","2803","2804","2805","2806","2807","2808"]},{"name":"Arachnid!","sprites":["2809","2810","2811","2812","2813","2814","2815","2816"]},{"name":"Slimey Little Pile","sprites":["2817","2818","2819","2820","2821","2822","2823","2824"]},{"name":"Black Antoid","sprites":["2825","2826","2827","2828","2829","2830","2831","2832"]},{"name":"Mobile Sprout","sprites":["2833","2834","2835","2836","2837","2838","2839","2840","2841"]},{"name":"No Good Fly","sprites":["2842","2843","2844","2845","2846","2847","2848","2849"]},{"name":"Skelpion","sprites":["2850","2851","2852","2853","2854","2855","2856","2857"]},{"name":"Lethal Asp Hieroglyph","sprites":["2858","2859","2860","2861","2862","2863","2864","2865","2866"]},{"name":"Rough Playing Mole","sprites":["2867","2868","2869","2870","2871","2872","2873","2874"]},{"name":"Petrified Royal Guard","sprites":["2875","2876","2877","2878","2879","2880","2881","2882","2883"]},{"name":"Noose Man","sprites":["2884","2885","2886","2887","2888","2889","2890","2891"]},{"name":"Thunder Mite","sprites":["2892","2893","2894","2895","2896","2897","2898","2899"]},{"name":"Guardian Hieroglyph","sprites":["2900","2901","2902","2903","2904","2905","2906","2907","2908"]},{"name":"Dali's Clock","sprites":["2909","2910","2911","2912","2913","2914","2915","2916"]},{"name":"Ego Orb","sprites":["2917","2918","2919","2920","2921","2922","2923","2924"]},{"name":"Master Belch","sprites":["2925","2926","2927","2928","2929","2930","2931","2932"]},{"name":"Cave Boy","sprites":["2933","2934","2935","2936","2937","2938","2939","2940"]},{"name":"Runaway Dog","sprites":["2941","2942","2943","2944","2945","2946","2947","2948"]},{"name":"Mighty Bear","sprites":["2949","2950","2951","2952","2953","2954","2955","2956"]},{"name":"Plain Crocodile","sprites":["2957","2958","2959","2960","2961","2962","2963","2964"]},{"name":"\"Your Sanctuary\" point boss","sprites":["2965","2966","2967","2968","2969","2970","2971","2972","2973"]},{"name":"Zombie","sprites":["2974","2975","2976","2977","2978","2979","2980","2981"]},{"name":"Surprised Ness","sprites":["2982","2983","2984","2985","2986","2987","2988","2989"]},{"name":"Surprised Paula","sprites":["2990","2991","2992","2993","2994","2995","2996","2997"]},{"name":"Surprised Jeff","sprites":["2998","2999","3000","3001","3002","3003","3004","3005"]},{"name":"Surprised Poo","sprites":["3006","3007","3008","3009","3010","3011","3012","3013"]},{"name":"Surprised Ness angel?","sprites":["3014","3015","3016","3017","3018","3019","3020","3021"]},{"name":"Surprised Paula angel?","sprites":["3022","3023","3024","3025","3026","3027","3028","3029"]},{"name":"Surprised Jeff angel?","sprites":["3030","3031","3032","3033","3034","3035","3036","3037"]},{"name":"Surprised Poo angel?","sprites":["3038","3039","3040","3041","3042","3043","3044","3045"]},{"name":"Diamondized surprised?","sprites":["3046","3047","3048","3049","3050","3051","3052","3053"]},{"name":"Small shadow","sprites":["3054","3055","3056","3057","3058","3059","3060","3061"]},{"name":"Teddy Bear","sprites":["3062","3063","3064","3065","3066","3067","3068","3069"]},{"name":"Runaway 5 pianist","sprites":["3070","3071","3072","3073","3074","3075","3076","3077"]},{"name":"Fly","sprites":["3078","3079","3080","3081","3082","3083","3084","3085"]},{"name":"Water Ring","sprites":["3086","3087","3088","3089","3090","3091","3092","3093"]},{"name":"Big Water Ring","sprites":["3094","3095","3096","3097","3098","3099","3100","3101"]},{"name":"Knocking on door","sprites":["3102","3103","3104","3105","3106","3107","3108","3109"]},{"name":"Heart","sprites":["3110","3111","3112","3113","3114","3115","3116","3117"]},{"name":"Cell phone","sprites":["3118","3119","3120","3121","3122","3123","3124","3125"]},{"name":"Hawk's eye","sprites":["3126","3127","3128","3129","3130","3131","3132","3133"]},{"name":"Ness' mom sitting","sprites":["3134","3135","3136","3137","3138","3139","3140","3141"]},{"name":"Venus","sprites":["3142","3143","3144","3145","3146","3147","3148","3149"]},{"name":"Rope","sprites":["3150","3151","3152","3153","3154","3155","3156","3157"]},{"name":"Tony kneeling","sprites":["3158","3159","3160","3161","3162","3163","3164","3165"]},{"name":"Ness' dog sleeping","sprites":["3174","3175","3176","3177","3178","3179","3180","3181"]},{"name":"Rock","sprites":["3182","3183","3184","3185","3186","3187","3188","3189"]},{"name":"New Age Retro Hippie","sprites":["3190","3191","3192","3193","3194","3195","3196","3197"]},{"name":"Poo meditating","sprites":["3198","3199","3200","3201","3202","3203","3204","3205"]},{"name":"Cat","sprites":["3206","3207","3208","3209","3210","3211","3212","3213"]},{"name":"Zombie Dog","sprites":["3214","3215","3216","3217","3218","3219","3220","3221"]},{"name":"Mu ghost","sprites":["3222","3223","3224","3225","3226","3227","3228","3229"]},{"name":"Flag of the Extinct Happy People?","sprites":["3230","3231","3232","3233","3234","3235","3236","3237"]},{"name":"Leaves","sprites":["3238","3239","3240","3241","3242","3243","3244","3245"]},{"name":"Tessie water ripples","sprites":["3246","3247","3248","3249","3250","3251","3252","3253","3254","3255","3256","3257","3258","3259","3260","3261"]},{"name":"Giygas to Ness Transform","sprites":["3262","3263","3264","3265","3266","3267","3268","3269"]},{"name":"A Plate","sprites":["3278","3279","3280","3281","3282","3283","3284","3285"]},{"name":"Drapes closed","sprites":["3286","3287","3288","3289","3290","3291","3292","3293"]},{"name":"Yellow drapes open","sprites":["3294","3295","3296","3297","3298","3299","3300","3301"]},{"name":"Yellow drapes closed","sprites":["3302","3303","3304","3305","3306","3307","3308","3309"]},{"name":"Police car","sprites":["3318","3319","3320","3321","3322","3323","3324","3325"]},{"name":"Ness Sleeping","sprites":["3326","3327","3328","3329","3330","3331","3332","3333"]},{"name":"Teddy Bear","sprites":["3334","3335","3336","3337","3338","3339","3340","3341","3342","3343","3344","3345","3346","3347","3348","3349"]},{"name":"Picky sitting","sprites":["3358","3359","3360","3361","3362","3363","3364","3365"]},{"name":"Ness Sleeping With Hat","sprites":["3366","3367","3368","3369","3370","3371","3372","3373"]},{"name":"Zzzs","sprites":["3374","3375","3376","3377","3378","3379","3380","3381"]},{"name":"Pay phone","sprites":["3382","3383","3384","3385","3386","3387","3388","3389"]},{"name":"Cop","sprites":["3390","3391","3392","3393","3394","3395","3396","3397"]},{"name":"Crooked Cop","sprites":["3398","3399","3400","3401","3402","3403","3404","3405"]},{"name":"Unassuming Local Guy","sprites":["3406","3407","3408","3409","3410","3411","3412","3413"]},{"name":"New Age Retro Hippie","sprites":["3414","3415","3416","3417","3418","3419","3420","3421"]},{"name":"Tough Guy","sprites":["3422","3423","3424","3425","3426","3427","3428","3429"]},{"name":"Annoying Old Party Man","sprites":["3430","3431","3432","3433","3434","3435","3436","3437"]},{"name":"Cranky Lady","sprites":["3438","3439","3440","3441","3442","3443","3444","3445"]},{"name":"Paula lying down","sprites":["3446","3447","3448","3449","3450","3451","3452","3453"]},{"name":"Jeff lying down","sprites":["3454","3455","3456","3457","3458","3459","3460","3461"]},{"name":"Poo lying down","sprites":["3462","3463","3464","3465","3466","3467","3468","3469"]},{"name":"Electra","sprites":["3470","3471","3472","3473","3474","3475","3476","3477"]},{"name":"Everdred","sprites":["3478","3479","3480","3481","3482","3483","3484","3485"]},{"name":"Li'l tenda","sprites":["3486","3487","3488","3489","3490","3491","3492","3493"]},{"name":"King in the Flashback","sprites":["3494","3495","3496","3497","3498","3499","3500","3501"]},{"name":"Bird","sprites":["3502","3503","3504","3505","3506","3507","3508","3509"]},{"name":"Frankystein Mk II","sprites":["3510","3511","3512","3513","3514","3515","3516","3517"]},{"name":"Red Fountain","sprites":["3518","3519","3520","3521","3522","3523","3524","3525"]},{"name":"Apple Kid sign","sprites":["3526","3527","3528","3529","3530","3531","3532","3533"]},{"name":"Orange Kid sign","sprites":["3534","3535","3536","3537","3538","3539","3540","3541"]},{"name":"Spa Sign","sprites":["3542","3543","3544","3545","3546","3547","3548","3549"]},{"name":"Past baby cradle","sprites":["3550","3551","3552","3553","3554","3555","3556","3557"]},{"name":"Eraser statue","sprites":["3558","3559","3560","3561","3562","3563","3564","3565"]},{"name":"$ box","sprites":["3566","3567","3568","3569","3570","3571","3572","3573"]},{"name":"Magnet Hill","sprites":["3574","3575","3576","3577","3578","3579","3580","3581"]},{"name":"Helicopter","sprites":["3582","3583","3584","3585","3586","3587","3588","3589"]},{"name":"Broken helicopter","sprites":["3590","3591","3592","3593","3594","3595","3596","3597"]},{"name":"Deep darkness \"phone\"","sprites":["3598","3599","3600","3601","3602","3603","3604","3605"]},{"name":"Magic Butterfly","sprites":["3606","3607","3608","3609","3610","3611","3612","3613"]},{"name":"Tools","sprites":["3614","3615","3616","3617","3618","3619","3620","3621"]},{"name":"Mole Playing Rough","sprites":["3622","3623","3624","3625","3626","3627","3628","3629"]},{"name":"Rowdy Mouse","sprites":["3630","3631","3632","3633","3634","3635","3636","3637"]},{"name":"Criminal Caterpillar","sprites":["3638","3639","3640","3641","3642","3643","3644","3645"]},{"name":"Clumsy Robot","sprites":["3646","3647","3648","3649","3650","3651","3652","3653"]},{"name":"Guardian digger","sprites":["3654","3655","3656","3657","3658","3659","3660","3661"]},{"name":"Helicopter blade","sprites":["3662","3663","3664","3665","3666","3667","3668","3669"]},{"name":"Sky Runner electric thingies","sprites":["3670","3671","3672","3673","3674","3675","3676","3677"]},{"name":"Wood box","sprites":["3678","3679","3680","3681","3682","3683","3684","3685"]},{"name":"Ornaments on Poo's Temple","sprites":["3686","3687","3688","3689","3690","3691","3692","3693"]},{"name":"Helicopter back","sprites":["3694","3695","3696","3697","3698","3699","3700","3701"]},{"name":"Rich Pokey's head","sprites":["3702","3703","3704","3705","3706","3707","3708","3709"]},{"name":"Bad Palette Fountain","sprites":["3710","3711","3712","3713","3714","3715","3716","3717"]},{"name":"Li'l Toucan Phone","sprites":["3718","3719","3720","3721","3722","3723","3724","3725"]},{"name":"ATM Guy Underwater","sprites":["3726","3727","3728","3729","3730","3731","3732","3733"]},{"name":"Instant Revitalizing Device","sprites":["3734","3735","3736","3737","3738","3739","3740","3741"]},{"name":"Secret door in Monotoli building","sprites":["3742","3743","3744","3745","3746","3747","3748","3749","3750","3751","3752","3753","3754","3755","3756","3757"]},{"name":"Magic Butterfly","sprites":["3758","3759","3760","3761","3762","3763","3764","3765"]},{"name":"Burglin Park sign","sprites":["3766","3767","3768","3769","3770","3771","3772","3773"]},{"name":"Lucky","sprites":["3774","3775","3776","3777","3778","3779","3780","3781"]},{"name":"Ness with messed palette","sprites":["3782","3783","3784","3785","3786","3787","3788","3789","3790","3791","3792","3793","3794","3795","3796","3797"]},{"name":"Exit mouse","sprites":["3798","3799","3800","3801","3802","3803","3804","3805"]},{"name":"Ness in PJs","sprites":["3806","3807","3808","3809","3810","3811","3812","3813","3814","3815","3816","3817","3818","3819","3820","3821"]},{"name":"Zombie lying down","sprites":["3822","3823","3824","3825","3826","3827","3828","3829"]},{"name":"Hotel sign","sprites":["3854","3855","3856","3857","3858","3859","3860","3861"]},{"name":"Camel","sprites":["3862","3863","3864","3865","3866","3867","3868","3869"]},{"name":"Trick or Trick Kid","sprites":["3870","3871","3872","3873","3874","3875","3876","3877"]},{"name":"Angel of Everdred","sprites":["3878","3879","3880","3881","3882","3883","3884","3885"]},{"name":"Hint man","sprites":["3886","3887","3888","3889","3890","3891","3892","3893"]},{"name":"Saturn Valley ATM","sprites":["3894","3895","3896","3897","3898","3899","3900","3901"]},{"name":"Runaway 5 member's head","sprites":["3902","3903","3904","3905","3906","3907","3908","3909"]},{"name":"Photographer's camera","sprites":["3910","3911","3912","3913","3914","3915","3916","3917"]},{"name":"Bad Palette Guy","sprites":["3918","3919","3920","3921","3922","3923","3924","3925"]},{"name":"Exit Mouse","sprites":["3926","3927","3928","3929","3930","3931","3932","3933"]},{"name":"Slots","sprites":["3934","3935","3936","3937","3938","3939","3940","3941"]},{"name":"Ness resting","sprites":["3942","3943","3944","3945","3946","3947","3948","3949"]},{"name":"Paula resting","sprites":["3950","3951","3952","3953","3954","3955","3956","3957"]},{"name":"Dept. Store Mook","sprites":["3958","3959","3960","3961","3962","3963","3964","3965"]},{"name":"Lying down robot Ness","sprites":["3974","3975","3976","3977","3978","3979","3980","3981"]},{"name":"Heavily Armed Pokey","sprites":["3982","3983","3984","3985","3986","3987","3988","3989"]},{"name":"Red truck","sprites":["3990","3991","3992","3993","3994","3995","3996","3997"]},{"name":"White truck","sprites":["3998","3999","4000","4001","4002","4003","4004","4005"]},{"name":"Master Criminal Worm","sprites":["4006","4007","4008","4009","4010","4011","4012","4013"]},{"name":"Tessie Water Ring","sprites":["4014","4015","4016","4017","4018","4019","4020","4021"]}];
|
|
|
|
function ebsprite() {
|
|
}
|
|
|
|
ebsprite.start = function(client) {
|
|
if(this.run) return;
|
|
|
|
var self = this;
|
|
|
|
this.run = true;
|
|
this.client = client;
|
|
this.canvas = document.createElement("canvas");
|
|
var canvas = this.canvas;
|
|
document.body.insertBefore(this.canvas, document.body.firstChild);
|
|
|
|
this.canvas.width = window.innerWidth;
|
|
this.canvas.height = window.innerHeight;
|
|
this.canvas.style.position = "absolute";
|
|
var camera = new Camera(this.canvas.width, this.canvas.height);
|
|
var context = this.canvas.getContext("2d");
|
|
context.fillStyle = "rgb(255,255,255)";
|
|
|
|
requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
|
|
window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
|
|
|
|
var ySort = function(a, b) {
|
|
return a.position.y - b.position.y;
|
|
};
|
|
|
|
var directionMap = {
|
|
"up": {x: 0, y: -1},
|
|
"up-right": {x: 0.707106782, y: -0.707106782},
|
|
"right": {x: 1, y: 0},
|
|
"right-down": {x: 0.707106782, y: 0.707106782},
|
|
"down": {x: 0, y: 1},
|
|
"down-left": {x: -0.707106782, y: 0.707106782},
|
|
"left": {x: -1, y: 0},
|
|
"left-up": {x: -0.707106782, y: -0.707106782}
|
|
};
|
|
|
|
var render_loop = function() {
|
|
var players = [];
|
|
for(var i in playerMap) {
|
|
players.push(playerMap[i]);
|
|
}
|
|
context.clearRect(0, 0, self.canvas.width, self.canvas.height);
|
|
for(var i in players) {
|
|
var player = players[i];
|
|
if(player.walking) {
|
|
var vec = directionMap[player.direction];
|
|
var time = Date.now() - player.updateTime;
|
|
player.position.x = player.updatePosition.x + (vec.x * player.walkSpeed * time);
|
|
player.position.y = player.updatePosition.y + (vec.y * player.walkSpeed * time);
|
|
if(player.position.x < 0) player.position.x = 0;
|
|
else if(player.position.x > canvas.width) player.position.x = canvas.width;
|
|
if(player.position.y < 0) player.position.y = 0;
|
|
else if(player.position.y > canvas.width) player.position.y = canvas.width;
|
|
}
|
|
}
|
|
players.sort(ySort);
|
|
for(var i in players) {
|
|
var player = players[i];
|
|
var img = player.spriteProvider.getCurrentSprite(player);
|
|
if(img) context.drawImage(img,
|
|
Math.floor(player.position.x - camera.position.x - (img.width / 2)),
|
|
Math.floor(player.position.y - camera.position.y - img.height));
|
|
/*if(player.chat) {
|
|
var text = player.chat;
|
|
var t = Math.floor((Date.now() - player.chatTime) / 50);
|
|
text = text.substring(0, t);
|
|
context.fillText(text,
|
|
Math.floor(player.position.x - camera.position.x),
|
|
Math.floor(player.position.y - camera.position.y - img.height) - 10);
|
|
}*/
|
|
}
|
|
if(self.run) requestAnimationFrame(render_loop);
|
|
};
|
|
render_loop();
|
|
|
|
this.onresize = function() {
|
|
canvas.width = $(window).width();
|
|
canvas.height = $(window).height();
|
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
}
|
|
window.addEventListener("resize", this.onresize);
|
|
|
|
function downloadImage(url, cb) {
|
|
var img = new Image();
|
|
img.onerror = function() {
|
|
cb("onerror", img);
|
|
};
|
|
img.onabort = function() {
|
|
cb("onabort", img);
|
|
};
|
|
img.onload = function() {
|
|
cb(false, img);
|
|
};
|
|
img.src = url;
|
|
};
|
|
|
|
function downloadImages(urls, cb) {
|
|
var imgs = new Array(urls.length);
|
|
var c = 0;
|
|
for(var i in urls) {
|
|
(function() {
|
|
var j = i;
|
|
downloadImage(urls[j], function(err, img) {
|
|
if(err) {
|
|
cb(err, imgs);
|
|
cb = function() {};
|
|
} else {
|
|
imgs[j] = img;
|
|
if(++c == urls.length) {
|
|
cb(false, imgs);
|
|
}
|
|
}
|
|
});
|
|
})();
|
|
}
|
|
};
|
|
|
|
function Camera(width, height) {
|
|
this.width = width;
|
|
this.height = height;
|
|
this.position = {x: 0, y: 0};
|
|
};
|
|
|
|
function SpriteProvider(sprites, cb) {
|
|
var urls = new Array(sprites.length);
|
|
for(var i in sprites) {
|
|
urls[i] = "/ebsprite/" + sprites[i] + ".png";
|
|
}
|
|
downloadImages(urls, (function(err, imgs) {
|
|
if(!err) {
|
|
var s = imgs;
|
|
this.sprites = {};
|
|
this.sprites["up"] = [s[0], s[1]];
|
|
this.sprites["right"] = [s[2], s[3]];
|
|
this.sprites["down"] = [s[4], s[5]];
|
|
this.sprites["left"] = [s[6], s[7]];
|
|
this.sprites["up-right"] = [s[8] || s[2], s[9] || s[3]];
|
|
this.sprites["right-down"] = [s[10] || s[2], s[11] || s[3]];
|
|
this.sprites["down-left"] = [s[12] || s[6], s[13] || s[7]];
|
|
this.sprites["left-up"] = [s[14] || s[6], s[15] || s[7]];
|
|
}
|
|
if(cb) cb();
|
|
}).bind(this));
|
|
};
|
|
|
|
//SpriteProvider.prototype.sprites = {};
|
|
SpriteProvider.prototype = new SpriteProvider(["2354","2355","2356","2357","2358","2359","2360","2361"]);
|
|
|
|
SpriteProvider.prototype.getCurrentSprite = function(player) {
|
|
if(this.sprites && this.sprites[player.direction]) {
|
|
if(player.walking) {
|
|
var time = Date.now() - player.updateTime;
|
|
return this.sprites[player.direction][time & 0x80 ? 0 : 1];
|
|
} else {
|
|
return this.sprites[player.direction][0];
|
|
}
|
|
}
|
|
};
|
|
|
|
var Player = function(id) {
|
|
this.id = id;
|
|
|
|
//this.sprites = spriteData[0].sprites;
|
|
this.sprites = spriteData[parseInt(id, 16) % spriteData.length].sprites;
|
|
this.spriteProvider = new SpriteProvider(this.sprites);
|
|
this.canMoveDiagonally = (this.sprites[8] && this.sprites[9] && this.sprites[10] && this.sprites[11] && this.sprites[12] && this.sprites[13] && this.sprites[14] && this.sprites[15]) ? true : false;
|
|
this.walkSpeed = 0.15;
|
|
|
|
this.direction = "down";
|
|
this.walking = false;
|
|
this.updatePosition = {
|
|
x: canvas.width / 2,
|
|
y: canvas.height / 2
|
|
};
|
|
this.position = {x: this.updatePosition.x, y: this.updatePosition.y};
|
|
this.updateTime = Date.now();
|
|
};
|
|
|
|
var player = new Player(client.participantId);
|
|
var playerMap = {}
|
|
playerMap[client.participantId] = player;
|
|
|
|
|
|
function move(id) {
|
|
var player = playerMap[id];
|
|
var part = client.ppl[id];
|
|
if(!player || !part) return;
|
|
var target = {x: (part.x / 100) * self.canvas.width, y: (client.ppl[id].y / 100) * self.canvas.height};
|
|
var difference = {x: target.x - player.position.x, y: target.y - player.position.y};
|
|
var distance = Math.sqrt(Math.pow(difference.x, 2) + Math.pow(difference.y, 2));
|
|
if(distance > 4) {
|
|
var angle = Math.atan2(difference.y, difference.x);
|
|
angle += Math.PI; // account negative Math.PI
|
|
angle += Math.PI / 8; // askew
|
|
angle /= (Math.PI * 2);
|
|
angle = Math.floor(angle * 8) % 8;
|
|
var direction = ["left", "left-up", "up", "up-right", "right", "right-down", "down", "down-left"][angle];
|
|
if(player.direction !== direction) {
|
|
if((Date.now() - player.updateTime > 500) || !player.walking) {
|
|
player.direction = direction;
|
|
player.updatePosition = {x: player.position.x, y: player.position.y};
|
|
player.updateTime = Date.now();
|
|
}
|
|
}
|
|
if(distance > 75) {
|
|
if(!player.walking) {
|
|
player.walking = true;
|
|
player.updatePosition = {x: player.position.x, y: player.position.y};
|
|
player.updateTime = Date.now();
|
|
}
|
|
}
|
|
}
|
|
if(distance < 25) {
|
|
if(player.walking) {
|
|
player.walking = false;
|
|
player.updatePosition = {x: player.position.x, y: player.position.y};
|
|
player.updateTime = Date.now();
|
|
}
|
|
}
|
|
}
|
|
|
|
this.animationInterval = setInterval(function() {
|
|
move(client.participantId);
|
|
for(var id in client.ppl) {
|
|
if(!client.ppl.hasOwnProperty(id)) continue;
|
|
move(id);
|
|
}
|
|
}, 50);
|
|
|
|
this.participantAdded = function(part) {
|
|
playerMap[part.id] = new Player(part.id);
|
|
}
|
|
for(var id in client.ppl) {
|
|
if(!client.ppl.hasOwnProperty(id)) continue;
|
|
playerMap[id] = new Player(id);
|
|
}
|
|
client.on("participant added", this.participantAdded);
|
|
|
|
this.participantRemoved = function(part) {
|
|
delete playerMap[part.id];
|
|
}
|
|
client.on("participant removed", this.participantRemoved);
|
|
}
|
|
|
|
ebsprite.stop = function() {
|
|
this.run = false;
|
|
if(this.canvas) {
|
|
document.body.removeChild(this.canvas);
|
|
this.canvas = undefined;
|
|
}
|
|
window.removeEventListener("resize", this.onresize);
|
|
clearInterval(this.animationInterval);
|
|
if(this.client) {
|
|
this.client.off("participant added", this.participantAdded);
|
|
this.client.off("participant removed", this.participantRemoved);
|
|
}
|
|
}
|
|
|
|
|