For my midterm, I decided to do a spin-off of a classic maze that is also heavily inspired by 2 other things I love: mystery and cats. The story of the game involves a person who is admiring an abandoned tomb that is said to hold a large treasure with their cat. Suddenly, something spooks the cats and it runs off into the tomb. It is then revealed that the tomb is like a maze, and the user must navigate through it. The catch? It’s pitch black apart from the small light from their flashlight and there are booby traps all around them. My idea is to have the user be able to call for the cat when a key like the spacebar is pressed, and when the cat responds, a larger part of the maze is temporarily revealed, as if the cat is just ahead of the user, running away or perhaps even guiding them through the maze until the user reaches the end/the treasure. Turning into a booby trap will result in “death” and the user will need to start over. I’m kind of imagining the layout to look like story pages or a comic book with the interactive game in the middle.
This task is certainly difficult as it requires a number of different elements, object-oriented programming, design/aesthetics, object animation, and even the possible use of sprites. Those sprites and getting the character and cat to move smoothly through the maze are the most challenging. Plus, getting the animation for booby traps and dealing with the character’s collision with them. Before I could even begin coding, it was really important that I knew what everything I would be designing looked like, so I tried to make it easier by finding gifs for specific animations I needed that could not be done in the program. That way, I knew exactly what I needed to try and create in the program myself and what I already have. For example, I found this gif of a cat being scared which I can use in the beginning scene when the cat is spooked and runs (I’m not sure if this website supports gifs, but you can kind of get the idea). I’m also working on creating the classes for all of the elements in the game right now. Here’s an example of what I have for the player, the traps, and even the cat:
class Player { constructor(x, y) { this.x = x; this.y = y; this.size = 20; } move() { if (keyIsDown(LEFT_ARROW)) this.x -= 2; if (keyIsDown(RIGHT_ARROW)) this.x += 2; if (keyIsDown(UP_ARROW)) this.y -= 2; if (keyIsDown(DOWN_ARROW)) this.y += 2; } display() { fill(255); ellipse(this.x, this.y, this.size); } } class Cat { constructor(x, y) { this.x = x; this.y = y; } } class Trap { constructor(x, y) { this.x = x; this.y = y; this.size = 20; } display() { fill(255, 0, 0); rect(this.x, this.y, this.size, this.size); } checkCollision(player) { return dist(player.x, player.y, this.x, this.y) < this.size; } }
Sounds good!