Cat Flat - Global Game Jam 2024
A game about frying fish for a hungry cat. Made in 48 hours for global game jam 2024 using my Graphics-Environment library built using C++ on vulkan and opengl.
Aim to cook as much fish as you can before the timer runs out! Once a fish has been cooked all the way through it will turn yellow, leaving it to rest will grant more time to cook. The longer the fish cook the more points received
Credits:
-
Laura King - Art and Game Design
-
Noam Zeise - Programming and Game Design
Implementation Details
The game uses a light warp effect on the screen applied to the final rendered image, you can control the intensity with the plus and minus buttons. It distorts the uv coordinates of the final texture by a function of sine and cosine to get a periodic distortion.
I render the final image as a texture on a square to the screen’s backbuffer. The texture which holds the rendered frame is sampled between the coordinates of 0 and 1 along the x and y axes, no matter the resolution of the game window, or the internal resolution of the final frame’s texture.
The shader must keep the four corners of the screen at their same positions when the warp is applied (ie (0, 0), (0, 1), (1, 0), (1, 1)). I used an exponential function with base x, as this ensures that as long as the exponent is greater than 0, we have x=0 gives f(x)=0, x=1 gives f(x)=1. I raise x to the power of some sines and cosines for a periodic warping, there is also some offsets and scaling to ensure the result is always greater than 0. The warp amount is a linear interpolation of the original position and the new warped position. Here is the shader code.
uv.x = (1 - warp) * uv.x
+ warp * pow(uv.x, f*(a + sin(-time) + cos(time)));
uv.y = (1 - warp) * uv.y
+ warp * pow(uv.y, f*(a + cos(-time) + sin(time)));
Many objects in the game are also squashed and squished by a scaling matrix with a periodic size to give the game a “bouncy” feel.
The pan and fish are all modelled as lines with an arbitrary rotation, so collision is easy to test.