Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset Swaps & Tile Changes #3

Draft
wants to merge 1 commit into
base: modernize
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/avatar-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/earth-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/grass-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/slime-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down