From 97ae756ebdb417052def343c108309829d7479f1 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 14 Mar 2024 00:54:34 -0700 Subject: [PATCH 1/3] Deprecated GIF module --- js/game/pet.js | 6 +++--- js/libs/{gif.js => gif.js.deprecated} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename js/libs/{gif.js => gif.js.deprecated} (100%) diff --git a/js/game/pet.js b/js/game/pet.js index 83a0ec6..10d73ee 100644 --- a/js/game/pet.js +++ b/js/game/pet.js @@ -1,4 +1,4 @@ -import { GIF } from "../libs/gif.js"; +//import { GIF } from "../libs/gif.js"; import { GameObject } from "./core.js"; // Our sprite sheet is on a grid of 64pxs @@ -69,8 +69,8 @@ export class Pet extends GameObject { this.petImage.src = "https://comfyui-output.nyc3.cdn.digitaloceanspaces.com/Group%204.png"; - this.petGif = GIF(); - this.petGif.load(this.gifSrc); + //this.petGif = GIF(); + //this.petGif.load(this.gifSrc); /** * Creates render sprite functions diff --git a/js/libs/gif.js b/js/libs/gif.js.deprecated similarity index 100% rename from js/libs/gif.js rename to js/libs/gif.js.deprecated From 81f65e3ed3ff4c2f35d72be897de0ae6de35255c Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 14 Mar 2024 00:54:59 -0700 Subject: [PATCH 2/3] Set default stage size --- js/game/stage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/game/stage.js b/js/game/stage.js index 6dee5fb..f31b00b 100644 --- a/js/game/stage.js +++ b/js/game/stage.js @@ -41,6 +41,8 @@ export class ComfyPetsStage extends ComfyNode { this.gameButton.fontWeight = "bold"; this.gameButton.fontFamily = "Courier New"; + this.size = [400,200] + // Stage objects this.pets = []; this.foods = []; From fdccfa04b1a4f13c199fcefa66577bc642855590 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 14 Mar 2024 01:07:07 -0700 Subject: [PATCH 3/3] Improved image quality --- js/game/pet.js | 15 ++++----------- js/game/stage.js | 3 +-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/js/game/pet.js b/js/game/pet.js index 10d73ee..611fc44 100644 --- a/js/game/pet.js +++ b/js/game/pet.js @@ -3,7 +3,7 @@ import { GameObject } from "./core.js"; // Our sprite sheet is on a grid of 64pxs // Each row is 64px tall, and each frame is 64px wide -const SPRITE_SIZE = 64; +const SPRITE_SIZE = 128; const SPRITE_SHEET = { JUMP: { row: 0, @@ -61,16 +61,9 @@ export class Pet extends GameObject { this.directionDuration = 0; // Assets - //this.gifSrc = "https://raw.githubusercontent.com/tonybaloney/vscode-pets/master/media/dog/akita_walk_8fps.gif" - //this.gifSrc = "./Group.png" - this.gifSrc = ""; + //this.gifSrc = ""; this.petImage = new Image(); - //this.petImage.src = "./Group.png" - this.petImage.src = - "https://comfyui-output.nyc3.cdn.digitaloceanspaces.com/Group%204.png"; - - //this.petGif = GIF(); - //this.petGif.load(this.gifSrc); + this.petImage.src = "https://comfyui-output.nyc3.cdn.digitaloceanspaces.com/corgi-sprite-128x128.png" /** * Creates render sprite functions @@ -216,7 +209,7 @@ export class Pet extends GameObject { slowFpsBy = 10 // Slows down fps by n amount ) { const _spriteFramesY = SPRITE_SIZE * spriteFramesY; - const spriteRenderSize = SPRITE_SIZE * 2; // This is the final size users see the sprite as + const spriteRenderSize = SPRITE_SIZE; // This is the final size users see the sprite as ctx.imageSmoothingEnabled = true; ctx.imageSmoothingQuality = "high"; diff --git a/js/game/stage.js b/js/game/stage.js index f31b00b..f2da5e7 100644 --- a/js/game/stage.js +++ b/js/game/stage.js @@ -50,8 +50,7 @@ export class ComfyPetsStage extends ComfyNode { // Assets this.backgroundImage = new Image(); - this.backgroundImage.src = - "https://media.istockphoto.com/id/1333010525/vector/simple-flat-pixel-art-illustration-of-cartoon-outdoor-landscape-background-pixel-arcade.jpg?s=612x612&w=0&k=20&c=uTGqB9fhmjzaNd17EGRHYU04_70K7a3M8ilRoJjDwtY="; + this.backgroundImage.src = "https://comfyui-output.nyc3.cdn.digitaloceanspaces.com/Summer2.png" } addPet() {