- fix rendering on higher refresh screens

- increase container size and match %300 pixel ratio
- halloween update
This commit is contained in:
gocivici 2024-10-28 09:56:00 -07:00
parent cdf1b84586
commit 63f547b432
46 changed files with 50 additions and 17 deletions

View File

@ -39,10 +39,10 @@ io.on('connection', (socket)=>{
console.log('user connected') console.log('user connected')
resetDisconnectTimer(); resetDisconnectTimer();
bPlayers[socket.id] = { bPlayers[socket.id] = {
x:615, x:790,
y:136, y:154,
clickX:615, clickX:790,
clickY:136, clickY:154,
roomId:1, roomId:1,
message:'', message:'',
username:"Visitor", username:"Visitor",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -18,6 +18,15 @@ before and after the text */
/* if you want something (like the header) to be Wider than /* if you want something (like the header) to be Wider than
the other elements, you will need to move that div outside the other elements, you will need to move that div outside
of the container */ of the container */
html{
/* image-rendering: optimizeSpeed; */
/* image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: pixelated;
image-rendering: optimize-contrast;
-ms-interpolation-mode: nearest-neighbor; */
}
.credits{ .credits{
margin-top: 10px; margin-top: 10px;
font-size: 12px; font-size: 12px;

View File

@ -397,7 +397,7 @@ before and after the text */
the other elements, you will need to move that div outside the other elements, you will need to move that div outside
of the container */ of the container */
#container { #container {
max-width: 960px; max-width: 1080px;
/* this is the width of your layout! */ /* this is the width of your layout! */
/* if you change the above value, scroll to the bottom /* if you change the above value, scroll to the bottom
and change the media query according to the comment! */ and change the media query according to the comment! */

Binary file not shown.

BIN
public/img/TV.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

BIN
public/img/fireplace.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
public/img/fireplace.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

View File

@ -27,7 +27,7 @@
<div class="scanlines"> <div class="scanlines">
<div class="screen"> <div class="screen">
<!-- <div class="asciiArt">Görkem's Webspace</div> --> <!-- <div class="asciiArt">Görkem's Webspace</div> -->
<div class="asciiArt">CyberCafe # *</div> <div class="asciiArt">SpookyCafe # *</div>
<script> <script>
figlet.defaults({ fontPath: "/css" }); figlet.defaults({ fontPath: "/css" });
ascii = document.getElementsByClassName("asciiArt"); ascii = document.getElementsByClassName("asciiArt");

View File

@ -47,8 +47,8 @@ if(!localStorage.getItem('username')){
} }
// setInterval(player.animate, 50); // setInterval(player.animate, 50);
canvas.width = 32 * 21 //672 canvas.width = 32 * 26//32 * 21 //672
canvas.height = 32 * 12 //384 canvas.height = 32 * 15 //32 * 12 //384
console.log(ctx); console.log(ctx);
@ -59,7 +59,16 @@ const room1 = new Sprite({
x:0, x:0,
y:0 y:0
}, },
imageSrc: './img/baackground.png' imageSrc: './img/baackground300adj.png'
})
const TV = new Sprite({
position:{
x:95,
y:122
},
imageSrc: './img/TV.png',
frames: 27
}) })
@ -145,17 +154,29 @@ function getCursorPosition(canvas, event) {
} }
// animate from point a to point b // animate from point a to point b
let frames_per_second = 60;
let animationId let interval = Math.floor(1000 / frames_per_second); // rounding down since our code will rarely run at the exact interval
// setInterval(animate, 60); let startTime = performance.now();
function animate(){ let previousTime = startTime;
let currentTime = 0;
let deltaTime = 0;
// set anmiation speed 60fps regardless of display refresh rate, based on: https://www.kirupa.com/animations/ensuring_consistent_animation_speeds.htm
function animate(timestamp){
ctx.imageSmoothingEnabled = false; ctx.imageSmoothingEnabled = false;
// console.log(pageVisible)
currentTime = timestamp;
deltaTime = currentTime - previousTime;
// console.log(pageVisible)
if (deltaTime > interval) {
previousTime = currentTime - (deltaTime % interval);
// ctx.clearRect(0,0,canvas.width,canvas.height); // ctx.clearRect(0,0,canvas.width,canvas.height);
room1.draw() room1.draw();
animationId = requestAnimationFrame(animate); TV.draw()
if(readyNow){ if(readyNow){
// ctx.drawImage(background,0,0); // ctx.drawImage(background,0,0);
@ -167,10 +188,13 @@ function animate(){
allfPlayer.update() allfPlayer.update()
// allfPlayer.message() // allfPlayer.message()
}
} }
// fPlayer = fPlayers[socket.id] // fPlayer = fPlayers[socket.id]
// if(){} // if(){}
// goToPosition(fPlayer,clickCoordinates) // goToPosition(fPlayer,clickCoordinates)
@ -178,7 +202,7 @@ function animate(){
// console.log(fPlayer.animationColumn) // console.log(fPlayer.animationColumn)
// return [incrementX,incrementY] // return [incrementX,incrementY]
} }
requestAnimationFrame(animate);
// function goToPosition(fPlayer,clickCoordinates){ // function goToPosition(fPlayer,clickCoordinates){
@ -188,7 +212,7 @@ function animate(){
animate() requestAnimationFrame(animate);