- fix rendering on higher refresh screens
- increase container size and match %300 pixel ratio - halloween update
@ -39,10 +39,10 @@ io.on('connection', (socket)=>{
|
||||
console.log('user connected')
|
||||
resetDisconnectTimer();
|
||||
bPlayers[socket.id] = {
|
||||
x:615,
|
||||
y:136,
|
||||
clickX:615,
|
||||
clickY:136,
|
||||
x:790,
|
||||
y:154,
|
||||
clickX:790,
|
||||
clickY:154,
|
||||
roomId:1,
|
||||
message:'',
|
||||
username:"Visitor",
|
||||
|
||||
BIN
public/characterSprites/Blue/64/Down.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Blue/64/Left.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Blue/64/Right.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Blue/64/Up.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
public/characterSprites/Green/64/Down.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Green/64/Left.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Green/64/Right.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Green/64/Up.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
public/characterSprites/Orange/64/Down.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Orange/64/Left.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Orange/64/Right.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Orange/64/Up.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
public/characterSprites/Red/64/Downold.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Red/64/Leftold.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Red/64/Right.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/characterSprites/Red/64/Up.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
@ -18,6 +18,15 @@ before and after the text */
|
||||
/* if you want something (like the header) to be Wider than
|
||||
the other elements, you will need to move that div outside
|
||||
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{
|
||||
margin-top: 10px;
|
||||
font-size: 12px;
|
||||
|
||||
@ -397,7 +397,7 @@ before and after the text */
|
||||
the other elements, you will need to move that div outside
|
||||
of the container */
|
||||
#container {
|
||||
max-width: 960px;
|
||||
max-width: 1080px;
|
||||
/* this is the width of your layout! */
|
||||
/* if you change the above value, scroll to the bottom
|
||||
and change the media query according to the comment! */
|
||||
|
||||
BIN
public/img/Sprite-0001.aseprite
Normal file
BIN
public/img/TV.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
public/img/baackground200.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
public/img/baackground300.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
public/img/baackground300adj.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
BIN
public/img/fireplace-export.png
Normal file
|
After Width: | Height: | Size: 829 B |
BIN
public/img/fireplace.gif
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
public/img/fireplace.png
Normal file
|
After Width: | Height: | Size: 607 B |
@ -27,7 +27,7 @@
|
||||
<div class="scanlines">
|
||||
<div class="screen">
|
||||
<!-- <div class="asciiArt">Görkem's Webspace</div> -->
|
||||
<div class="asciiArt">CyberCafe # *</div>
|
||||
<div class="asciiArt">SpookyCafe # *</div>
|
||||
<script>
|
||||
figlet.defaults({ fontPath: "/css" });
|
||||
ascii = document.getElementsByClassName("asciiArt");
|
||||
|
||||
@ -47,8 +47,8 @@ if(!localStorage.getItem('username')){
|
||||
}
|
||||
// setInterval(player.animate, 50);
|
||||
|
||||
canvas.width = 32 * 21 //672
|
||||
canvas.height = 32 * 12 //384
|
||||
canvas.width = 32 * 26//32 * 21 //672
|
||||
canvas.height = 32 * 15 //32 * 12 //384
|
||||
|
||||
console.log(ctx);
|
||||
|
||||
@ -59,7 +59,16 @@ const room1 = new Sprite({
|
||||
x: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
|
||||
let frames_per_second = 60;
|
||||
|
||||
let animationId
|
||||
// setInterval(animate, 60);
|
||||
function animate(){
|
||||
let interval = Math.floor(1000 / frames_per_second); // rounding down since our code will rarely run at the exact interval
|
||||
let startTime = performance.now();
|
||||
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;
|
||||
|
||||
currentTime = timestamp;
|
||||
deltaTime = currentTime - previousTime;
|
||||
// console.log(pageVisible)
|
||||
|
||||
if (deltaTime > interval) {
|
||||
previousTime = currentTime - (deltaTime % interval);
|
||||
// ctx.clearRect(0,0,canvas.width,canvas.height);
|
||||
room1.draw()
|
||||
animationId = requestAnimationFrame(animate);
|
||||
room1.draw();
|
||||
TV.draw()
|
||||
|
||||
if(readyNow){
|
||||
// ctx.drawImage(background,0,0);
|
||||
|
||||
@ -169,8 +190,11 @@ function animate(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// fPlayer = fPlayers[socket.id]
|
||||
|
||||
|
||||
// if(){}
|
||||
// goToPosition(fPlayer,clickCoordinates)
|
||||
|
||||
@ -178,7 +202,7 @@ function animate(){
|
||||
// console.log(fPlayer.animationColumn)
|
||||
// return [incrementX,incrementY]
|
||||
}
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
// function goToPosition(fPlayer,clickCoordinates){
|
||||
|
||||
|
||||
@ -188,7 +212,7 @@ function animate(){
|
||||
|
||||
|
||||
|
||||
animate()
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
|
||||
|
||||
|
||||