A little experiment where I built a 3D Tamagotchi-style pet using React Three Fiber, and a canvas-based game engine running inside a 3D model mesh layer.
Like most other 90's kids, I had a Tamagotchi when I was younger. I remember the excitement of taking care of it, feeding it, and playing with it. I wanted to recreate that experience in the browser, using the web and 3D graphics as a way to experiment with React Three.
I'm not too familiar with 3D modeling, so I made some updates to a Blender base model from Sketchfab. I then used React Three Fiber to render the model in the browser, and added a simple game engine to handle the interactions.
I used a simple state machine to manage the different states of the pet (though for now there aren't many states as one of my largest hurdles was designing the pet animation states).
I designed the pet to look like myself, in a 1 bit art style. I stored the animations as a series of matrix coordinates so that they could be easily rendered and animated in the game engine.
Like many of my projects, this one is a work in progress. I plan to add more interactivity and animations in the future, as well as updating the 3D model, but for now, it's a fun little experiment that shows how some of the fundementals for this project would be setup.