From 6f548a1b47e2927e43fbf8c00f812a1abf1f4849 Mon Sep 17 00:00:00 2001 From: Mal Date: Sat, 23 Sep 2023 20:39:10 +0200 Subject: [PATCH] Death Star graphic set added --- js/GraphicSet.js | 17 ++++++++++++++--- js/retro/RetroArchitecture.js | 6 +++--- tilorswift/style.css | 3 +++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/js/GraphicSet.js b/js/GraphicSet.js index efda498..c48c70f 100644 --- a/js/GraphicSet.js +++ b/js/GraphicSet.js @@ -5,7 +5,8 @@ let GraphicSet = [ tiles: 8, scale: 3, backgroundColor: '#6096ff', - backgroundImage: null + backgroundImage: null, + tilePreview: 5 }, { name: 'Moon', @@ -13,8 +14,18 @@ let GraphicSet = [ tiles: 2, scale: 3, backgroundColor: 'black', - backgroundImage: 'background_earth.jpg' - } + backgroundImage: 'background_earth.jpg', + tilePreview: 1 + }, + { + name: 'Death Star', + tileset: 'deathstar.png', + tiles: 96, + scale: 1, + backgroundColor: '#171721', + backgroundImage: null, + tilePreview: 1 + } ]; export default GraphicSet; diff --git a/js/retro/RetroArchitecture.js b/js/retro/RetroArchitecture.js index 1b7900b..e34b8ae 100644 --- a/js/retro/RetroArchitecture.js +++ b/js/retro/RetroArchitecture.js @@ -224,12 +224,12 @@ export default class RetroArchitecture { context.drawImage( this.tilesetSprite.canvas, - field.tile.index * this.tileWidth, + (field.tile.index % this.tiles) * this.tileWidth, 0, this.tileWidth, this.tileHeight, - x * this.tileWidth - camera.position.x, - y * this.tileHeight - camera.position.y, + x * this.tileWidth - camera.position.x - 1, + y * this.tileHeight - camera.position.y - 1, this.tileWidth + 1, this.tileHeight + 1 ); diff --git a/tilorswift/style.css b/tilorswift/style.css index 1f436d4..4b453b7 100644 --- a/tilorswift/style.css +++ b/tilorswift/style.css @@ -112,6 +112,9 @@ body { top: 0; background-color: #cccccc; box-shadow: 20px 20px 20px rgba(0, 0, 0, 0.5); + max-width: 1000%; + max-height: 500%; + overflow: auto; } #tileset-picker:hover > #tileset-selector-widget {