Concept
When visiting different cafes, I often think how challenging it is for the waiters to keep in mind the orders of all people at the table – quite often they would place a dish your friend ordered in front of you instead, and then you will just exchange the plates by yourself. Not a big deal, right? But visitors rarely think about the actual pressure in this kind of working environment – time, tastes, and preferences count for every customer.
I have decided to create a mini game that allows the player to experience how tricky it can actually be to serve the dishes during a rush hour. There is an extra challenge – the user is accompanying a table of two people on their first date, one of them is vegan and another loves meet. Will everything go as planned?
Sketch
https://editor.p5js.org/am13870/sketches/3_efwXDWQ
Highlight of the code
The most challenging part that I have managed to implement into my code was the functionality of the plates and the dishes on them. The falling dishes get attached to plate when caught by the user, and then the plate is dragged to the edge of the table. Vegetable-based dishes have to be dragged to the left, to Leonie, and meat-based dishes have to be dragged to the right, to Santi. If the player serves the dishes correctly, they get a tip – and I they don’t, they lose it.
Managing the interdependence of these objects was very tricky, but I have managed to defined specific functions within the classes so that everything appears and disappears when needed. Furthermore, setting up the winning and loosing conditions took time, so I have followed the guidelines from the class slides to add navigation through the screens.
display() {
image(plate2Patterned, this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
// displaying the dish attached to the plate
if (this.attachedShape) {
this.attachedShape.x = this.x;
this.attachedShape.y = this.y;
this.attachedShape.display();
}
}
mousePressed() {
let d = dist(mouseX, mouseY, this.x, this.y);
if (d < this.radius) {
this.dragging = true;
this.offsetX = this.x - mouseX;
}
}
mouseReleased() {
this.dragging = false;
}
attachShape(shape) {
if (this.attachedShape === null) {
this.attachedShape = shape;
}
}
resolveShape() {
if (this.attachedShape.type === 'vegetable' && this.x - this.radius <= 50) {
score += 1;
} else if (this.attachedShape.type === 'vegetable' && this.x + this.radius >= 750) {
score -= 1;
} else if (this.attachedShape.type === 'meat' && this.x + this.radius >= 750) {
score += 1;
} else if (this.attachedShape.type === 'meat' && this.x - this.radius <= 50) {
score -= 1;
}
// removing the dish as it reaches the end
this.attachedShape = null;
}
}
Reflection
I have started the project by developing the “physics” part, so that all objects in a simplified style would move correctly. For example, the dishes were drawn as triangles and squares at first. After finalising this part, I have moved on to adding the detailed visuals – this was not the easiest part as well, but I enjoyed developing a certain aesthetic of the game.
I started the design stage by going back to the original reference for the game idea, the photograph by Nissa Snow, which depicts a long table with dishes on it. Using Adobe Illustrator, I have created the table for my game, adding and editing images of objects that follow an artistic, slightly random, almost incompatible aesthetic. Then I used Procreate to draw the introduction screen, the victory, and the loss slides that are shown depending on the outcome of the game. The illustrations were created in a minimalistic manner in order not to clash with clutteredness of the table.
Future improvements
To develop this mini game further, I would add more conditions for the player – for example, new sets of guests can come and go, their dietary preferences can change. This would require implementation of several more arrays and functions to set up the food preferences, and I think this is an interesting direction to dive into.