diff --git a/assets/avatar-sheet.png b/assets/avatar-sheet.png new file mode 100644 index 0000000..735479e Binary files /dev/null and b/assets/avatar-sheet.png differ diff --git a/assets/earth-01.png b/assets/earth-01.png new file mode 100644 index 0000000..c370095 Binary files /dev/null and b/assets/earth-01.png differ diff --git a/assets/grass-32x32.png b/assets/grass-32x32.png new file mode 100644 index 0000000..1473421 Binary files /dev/null and b/assets/grass-32x32.png differ diff --git a/assets/slime-blue.png b/assets/slime-blue.png new file mode 100644 index 0000000..b3dabec Binary files /dev/null and b/assets/slime-blue.png differ diff --git a/components/index.js b/components/index.js index 4e86cd1..078dd05 100644 --- a/components/index.js +++ b/components/index.js @@ -36,8 +36,8 @@ async function UI () { let copycat_mode = false; let default_walk_speed = 5; let default_jump_speed = 25; - let map_size = 30; - let tile_size = 50; + let map_size = 32; + let worldSize = 64; let tile_index = {}; //keyboard stuff @@ -307,38 +307,38 @@ async function UI () { for(let i=0; i<30; i++){ bricks.push(new Sprite(brick, 512, 512, 50, 50, i*50, 600)); }*/ - let grass = images.getImage('grass.jpg'); + let grass = images.getImage('grass-32x32.png'); for (let j = 0; j< map_size; j++) { for (let i = 0; i < map_size; i++) { - let tile = new Sprite(grass, 100, 100, 50, 50, i * 50, j * 50) + let tile = new Sprite(grass, 32, 32, 32, 32, i * 32, j * 32) tile.bg = true; bricks.push(tile); } } - let rocks = images.getImage('rocks.jpg'); + let rocks = images.getImage('dark-earth-01.png'); for (let j = 0; j< map_size; j++) { - bricks.push(new Sprite(rocks, 400, 400, tile_size, tile_size, j * tile_size, -tile_size)); - bricks.push(new Sprite(rocks, 400, 400, tile_size, tile_size, j * tile_size, map_size * tile_size)); - bricks.push(new Sprite(rocks, 400, 400, tile_size, tile_size, -tile_size, j * tile_size)); - bricks.push(new Sprite(rocks, 400, 400, tile_size, tile_size, map_size * tile_size, j * tile_size)); + bricks.push(new Sprite(rocks, 32, 32, 32, 32, j * worldSize, -worldSize)); + bricks.push(new Sprite(rocks, 32, 32, 32, 32, j * worldSize, map_size * worldSize)); + bricks.push(new Sprite(rocks, 32, 32, 32, 32, -worldSize, j * worldSize)); + bricks.push(new Sprite(rocks, 32, 32, 32, 32, map_size * worldSize, j * worldSize)); } - let wall = images.getImage('brick.png'); + let wall = images.getImage('earth-01.png'); - for (let i = 2; i < 20; i++) { bricks.push(new Sprite(wall, 200, 200, 50, 50, i * 50, 2 * 50)); } - for (let i = 2; i < 15; i++) { bricks.push(new Sprite(wall, 200, 200, 50, 50, i * 50, 12 * 50)); } - for (let i = 2; i < 20; i++) { bricks.push(new Sprite(wall, 200, 200, 50, 50, 18 * 50, i * 50)); } + for (let i = 2; i < 20; i++) { bricks.push(new Sprite(wall, 32, 32, 32, 32, i * 50, 2 * 50)); } + for (let i = 2; i < 15; i++) { bricks.push(new Sprite(wall, 32, 32, 32, 32, i * 50, 12 * 50)); } + for (let i = 2; i < 20; i++) { bricks.push(new Sprite(wall, 32, 32, 32, 32, 18 * 50, i * 50)); } } function loadPlayers () { - let mario = images.getImage('mario.png'); + let avatar = images.getImage('avatar-sheet.png'); - player = new Sprite(mario, 480, 640, 48, 64, 380, 380); + player = new Sprite(avatar, 19, 26, 19, 26, 380, 380); player.dx = 0; player.dy = 0; player.walkspeed = default_walk_speed; @@ -356,10 +356,10 @@ async function UI () { players.push(player2); } - let goomba = images.getImage('goomba.png'); + let slime = images.getImage('slime-blue.png'); for(let i = 0; i<7; i++) { - let player3 = new Sprite(goomba, 900, 900, 48, 64, i * 200, i * 200 + 100); + let player3 = new Sprite(slime, 32, 32, 64, 64, i * 200, i * 200 + 100); player3.dx = Math.floor( application.machine.generator.next.percent() * 3 + 2 ); player3.dy = Math.floor( application.machine.generator.next.percent() * 3 + 2);