Skip to content

Commit

Permalink
Add walls colors to floors maps, fix opacity, remove positionlabel
Browse files Browse the repository at this point in the history
  • Loading branch information
VityaSchel committed Jan 10, 2024
1 parent 4d22422 commit c6c4d1a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
Binary file modified src/assets/map/floor-1.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 modified src/assets/map/floor-2.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 modified src/assets/map/floor-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/radar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ export function initRadar() {
}
}

const moveCharacter = (character: HTMLElement, xpos: number, ypos: number, dir: 'N' | 'S' | 'W' | 'E', speed) => {
const moveCharacter = (character: HTMLElement, xpos: number | 'stairs', ypos: number | 'stairs', dir: 'N' | 'S' | 'W' | 'E', speed) => {
const floorMap = floors[window.floor - 2]
if (!floorMap) {
return
}

const point = floorMap.points.find(point => point.xpos === xpos && point.ypos === ypos)
const point = xpos === 'stairs' || ypos === 'stairs'
? floorMap.stairs
: floorMap.points.find(point => point.xpos === xpos && point.ypos === ypos)
if (!point) {
console.error('Couldn\'t find point with coordinates' + `${xpos},${ypos}`)
character.style.transition = 'left 0s, top 0s'
Expand Down Expand Up @@ -133,8 +135,7 @@ export function initRadar() {

if (window.inroom === 0) {
if (window.stairs === 2) {
const { x, y } = floorMap.stairs
moveCharacter(maya, x, y, 'N', skipTransition ? '0s' : '1s')
moveCharacter(maya, 'stairs', 'stairs', 'N', skipTransition ? '0s' : '1s')
} else {
const xpos = window.pos[0]
const ypos = window.pos[1]
Expand Down Expand Up @@ -262,7 +263,7 @@ export function initRadar() {
}

const checkIfJimmyInRoomWithMaya = () => {
if(window.jhinroom === window.inroom) {
if (window.inroom !== 0 && window.jhinroom === window.inroom) {
maya.style.opacity = '0.1'
} else {
maya.style.opacity = '1'
Expand Down
30 changes: 15 additions & 15 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ export function onPropertyChange(name: string, callback: () => void) {
}

// DISPLAY X/Y POSITION on screen:
const positionlabel = document.createElement('span')
positionlabel.id = 'position-label'
positionlabel.style.zIndex = '1000'
positionlabel.style.pointerEvents = 'none'
positionlabel.style.position = 'absolute'
positionlabel.style.top = '50%'
positionlabel.style.left = '50%'
positionlabel.style.transform = 'translate(-50%, -50%)'
positionlabel.style.font = 'bold 196px monospace'
positionlabel.style.color = 'white'
positionlabel.style.textShadow = '0 0 10px black'
document.body.appendChild(positionlabel)
setInterval(() => {
positionlabel.innerText = `${window.pos[0]},${window.pos[1]}`
}, 100)
// const positionlabel = document.createElement('span')
// positionlabel.id = 'position-label'
// positionlabel.style.zIndex = '1000'
// positionlabel.style.pointerEvents = 'none'
// positionlabel.style.position = 'absolute'
// positionlabel.style.top = '50%'
// positionlabel.style.left = '50%'
// positionlabel.style.transform = 'translate(-50%, -50%)'
// positionlabel.style.font = 'bold 196px monospace'
// positionlabel.style.color = 'white'
// positionlabel.style.textShadow = '0 0 10px black'
// document.body.appendChild(positionlabel)
// setInterval(() => {
// positionlabel.innerText = `${window.pos[0]},${window.pos[1]}`
// }, 100)

0 comments on commit c6c4d1a

Please sign in to comment.