Skip to content

Commit

Permalink
make emotes separate from speech bubbles and not flipped
Browse files Browse the repository at this point in the history
  • Loading branch information
cheryllium committed Jan 4, 2024
1 parent 82410d8 commit 0dc46e8
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 7 deletions.
Binary file added assets/emotes/angry.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 assets/emotes/happy.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 assets/emotes/heart.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 assets/emotes/sleepy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/speech-bubbles.aseprite
Binary file not shown.
Binary file removed assets/speech/speech-bubble-angry.png
Binary file not shown.
Binary file removed assets/speech/speech-bubble-happy.png
Binary file not shown.
Binary file removed assets/speech/speech-bubble-heart.png
Binary file not shown.
Binary file removed assets/speech/speech-bubble-sleepy.png
Binary file not shown.
11 changes: 6 additions & 5 deletions src/fish.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,18 @@ export default class Fish {
scale(-1, 1);
image(fishImage, -fishImage.width, 0);
if (this.emotion) {
image(emoteImages[this.emotion],
-emoteImages[this.emotion].width - fishImages[this.type-1].width + 15,
-20);
image(speechBubbleImage, -fishImage.width - speechBubbleImage.width, -20);
scale(-1, 1);
image(emoteImages[this.emotion], fishImage.width + 10, -17);
}
pop();
} else {
image(fishImage, this.x, this.y);
if (this.emotion) {
image(speechBubbleImage, this.x - speechBubbleImage.width, this.y - 20);
image(emoteImages[this.emotion],
this.x - fishImage.width + emoteImages[this.emotion].width/2 + 15,
this.y - 20);
this.x - speechBubbleImage.width + emoteImages[this.emotion].width/2 - 5,
this.y - 17);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ window.NUM_TYPES_FISH = 10;

window.bg = null; // The aquarium's background image
window.fishImages = []; // The fish images
window.fishImagesSelected = [];
window.fishImagesSelected = [];
window.speechBubbleImage = null;
window.emoteImages = {
heart: null,
happy: null,
Expand Down Expand Up @@ -44,8 +45,9 @@ function preload() {
}

// Load emote images
speechBubbleImage = loadImage("assets/speech-bubble-blank.png");
for(let key of Object.keys(emoteImages)) {
emoteImages[key] = loadImage(`assets/speech/speech-bubble-${key}.png`)
emoteImages[key] = loadImage(`assets/emotes/${key}.png`)
}

// Load food images
Expand Down

0 comments on commit 0dc46e8

Please sign in to comment.