Skip to content

Commit

Permalink
expanded map
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmiccoder committed Feb 9, 2022
1 parent e2cc8a2 commit 1253104
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
Binary file modified images/official_assets/ourMap32.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 images/official_assets/ourMap32Old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions js/Overworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ class Overworld {
constructor(config) {
this.element = config.element;
this.canvas = this.element.querySelector(".game-canvas");
// this.canvas.height = window.innerHeight;
// this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
this.canvas.width = window.innerWidth;


// this.gameContainer = this.element.querySelector(".game-container");
// this.gameContainer.style.width = window.innerWidth;
// this.gameContainer.style.height = window.innerHeight;


// this.canvas.height = 1000; // TODO: Change this!
// this.canvas.width = 1500;

console.log(this.canvas.height, this.canvas.width);
console.log(this.canvas.width, this.canvas.height);

this.context = this.canvas.getContext("2d");
this.map = null;
Expand Down
4 changes: 2 additions & 2 deletions js/OverworldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OverworldMap {

drawLowerImage(context, cameraPerson) {
// context.drawImage(this.lowerImage, utils.withGrid(10.5) - cameraPerson.x, utils.withGrid(6) - cameraPerson.y);
context.drawImage(this.lowerImage, utils.withGrid(10.15) - cameraPerson.x, utils.withGrid(6.5) - cameraPerson.y); // fixing offset
context.drawImage(this.lowerImage, utils.withGrid(10.33) - cameraPerson.x, utils.withGrid(6.5) - cameraPerson.y); // fixing offset
}

drawUpperImage(context, cameraPerson) {
Expand Down Expand Up @@ -109,7 +109,7 @@ class OverworldMap {

window.OverworldMaps = {
DemoRoom: {
lowerSrc: "./images/official_assets/ourMap32.png", // current best map is=
lowerSrc: "./images/official_assets/ourMap32.png", // current best map is= ./images/official_assets/ourMap32.png
// lowerSrc: "./images/ourMap16.png",
// lowerSrc: "./images/DemoLower.png",
upperSrc: "./images/DemoUpper.png",
Expand Down
11 changes: 7 additions & 4 deletions styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* {
box-sizing: border-box;
}

body {
background-color: #202020;
padding: 0;
Expand All @@ -20,17 +21,19 @@ body {

.game-container{
position: relative;
width: 352px;
height: 198px;
/* width: 352px; */
/* height: 198px; */
/* height: 550px; */
/* height: 100vh; */
/* width: 100vw; */
/* margin: 0 auto; */
margin: 0;
outline: 1px solid white;

transform: scale(3) translateY(50%);
transform: scale(1.50) translateY(50%) translateX(90%);
/* transform: scale(3) translateY(-50%); */
/* transform: scale(1.5) translateY(50%) translateX(30%); */
transform: translate(0,0);
/* transform: scale(1.5); */
/* transform: scale(1) translateY(30%) translateX(50%); */
/* transform:translateY(20%); */
}
Expand Down

0 comments on commit 1253104

Please sign in to comment.