Midterm Progress

Here is the link to game

Originally, I was going to do a game similar to i-Spy, but I wasn’t happy with that idea. So I decided to stick to a Studio Ghibli theme and do something like related to the movie Spirited Away. In the movie, there is a character called No Face who goes to the bathhouse and eats a lot of food. So I thought it would be a fun idea to recreate that by making it rain food and have the player try to catch the raining food by controlling No Face. The things I need to for this game to work are:

    • Mouse click to catch the food and make it disappear
    • A counter to keep track of the score
    • Game states (title screen, game playing, and game over)
    • Restart and exit game buttons
    • Food “raining”
    • The character No Face for the player to control
    • Adding sound effects and background music

There might be more things I need to add, but this is the general idea. So far I have playing mode, the character, and the food raining. I still need to work on how No Face will catch the food, the counter, and the different states of the game.

Code Highlight
// From The Coding Train Flappy Bird Coding Challenge:
// https://editor.p5js.org/codingtrain/sketches/FtBc2BhHM
for(let i = addFoods.length - 1; i >= 0; i--) {
  addFoods[i].rainingFood();
  addFoods[i].show();
}

// A new food is pushed every time the frameCount is divisible by 50 or 100
if(frameCount % 50 == 0) {
   addFoods.push(new Food());
} else if(frameCount % 100 == 0) {
  addFoods.push(new Food());
}

// print(frameCount);

I used Object Oriented Programming for the food so I can add food images to the canvas based on the frame count. This code snippet I got from a Coding Train video, which was super helpful for my game.

 

for (let i = 0; i < 5; i++) {
    foods[i] = loadImage("Assets/food" + i + ".png")
}

Another part that I want to highlight is this chunk of code, which is my favorite hack. It’s such a smart and efficient idea to loop through the images by using the same name for the food images.

Future Directions

Since this is a progress check, I still have a lot to work on. For instance, making this an actual game where the food can be eaten and there’s an end. It will be a challenge, but hopefully I can figure it out. I was thinking of adding another object that can injure the character and take away points or lives, but I’m going to stick with figuring out how to catch the food first.

Leave a Reply