Desktop Pet! banner

Desktop Pet!

8 devlogs
6h 26m 20s

Designing a desktop pet in python! I aim to expand my language knowledge, while making a fun personal project. It has a few actions and is just a little fun thing to have on my screen while gaming.

This project uses AI

Used Gemini to figure out how to package into an exe and make that exe function correctly

Demo Repository

Loading README...

Olo the Fox

Little fixes here and there.
The ball is able to be dragged now! The fox can follow it around while you move it!
In order to package as an exe, I had to do a little work on how images are handled using a method. I don’t fully understand it, as I haven’t worked with the os or sys libraries yet. I’ll likely approach them in a future project. But now it properly works.
Additionally I figured out how to release on github. Already releasing this fix to it now lol.

0
Olo the Fox

Shipped this project!

Hours: 5.86
Cookies: 🍪 149
Multiplier: 25.38 cookies/hr

I made a desktop pet, specifically a fox, in python! It’ll walk around the screen, sit, and you’re able to drag it around. It was a project to get me back into coding and to learn python. It was a bit difficult at first getting used to the syntax, and even more difficult to under tkinter, the gui library I used for the program. The gui library differs from others I’ve tried in javascript and roblox before, because those were guided inside of classes. I’m pretty happy with it, as I made all the sprites and code for it by myself! Researching is hard and tedious, but makes a worthwhile impact in the end.

Olo the Fox

I’m pretty much finished with the desktop pet for the time being.
I implemented a carrying animation for when the fox is carried by the mouse. After he is dropped, he choses a random event to occur.
Additionally, I added a ball that spawns in on a random part of the screen, which the fox follows after sometimes as an event.
I’m pretty happy with my finished product. I learned a lot, and I will work on it again in the future.
I want to add the option to have multiple pets at once, but I’d likely have to rewrite my code from the beginning. It’s a project for another week.

0
Olo the Fox

Devlog 6
I finally have the first basic model of a fox desktop pet. It has two different animations, one of sitting, and one of walking. Three behaviors, one sitting, one walking mainly in the x axis, the other behavior on the y axis.
I aim to add more and today was another day of laying groundwork.
I had to research the pillow image library and ways to traverse lists in order to mirror my walking animation. I prefer to use a loop to take images from an existing list and make a new list of photoImages, as then it makes it easier for implementing in the future, if I wanted to use the reversing technique for other animations. Additionally, it requires less images to be made/hardcoded.
Additionally I made a mainController function, works in function as a main loop. This way I can call to behavior and animations without everything being desynced with different loops.
The behavior function is just meant to make the code less crowded in the mainController, so I can call to behavior to do the event.
To Do:
Drag event (picking up fox, changes anim, and fox cannot move)
Sleep event (same as sit, but with sleepy animation)
Up/Down Walking anims
Fox interactions with desktop/computer? (Would help me dive deeper into python)
File management (Images in image folder)
Another window at launch for settings (num of foxes, time between events)
Maybe few interactions such as treats spawning on desktop, feeding
Compile into executable

0
Olo the Fox

Devlog 5
Laying groundwork for the big step of tomorrow, movement events
I wrote a movement function in order to address the problems of movement tomorrow.
It limits movement within 0 and the screen size subtract window size. This way my little guy will stay on screen
Additionally I researched into dragging tkinter windows. This will be used for an animation of picking my fox up and moving him around the screen. Took a bit of bug testing and a lot of research, and I found out that I need to save the relative position of the mouse on the window before dragging it, to keep it smooth. Kinda strange, but makes sense.
Tomorrow I hopefully will have enough motivation to code my guy’s events.

0
Olo the Fox

Devlog 4
Today I made a simple sitting animation for my foxy -w-
I rewrote the script from the beginning, referencing my prior, just so I could better understand my work and clean it up.
I successfully made the animation play with a lot of testing; Initially I did an approach to load individual frames beforehand, then switch them out. Other approaches used lists to preload and display images, which is much more efficient, so I used that method in the end. It makes it easier for when I need to implement other animations in the future.
However with the new sprite, I approached difficulties with the GUI, as white outline appeared on my image. I learned that using the .grid method from tkinter isn’t the best way to display a image. Not sure on the specifics, but using .pack seems to work better.
Finally, I got started on the events function. It’ll randomly change events, in a currently undetermined amount of time. I don’t want event changes to be too quick, but not too long either.
I only have event one, which is sitting. I’ll likely start on the second, either sleeping or walking, once I’m done with their sprites.

0
Olo the Fox

Devlog 3
Been busy yesterday and the day before, but I got some stuff put in today.
I was playing around with the random library for movement. I’ll likely just have to script movement patterns, then have them randomly have a chance to happen.
I also figured out how to prevent the window from going off screen.
Tomorrow, I’ll try to start on actually scripting movement patterns.

0
Olo the Fox

Devlog #2
Today I researched how to use images with tkinter, and additionally looked into window movement. I know now how to change images, which then I’ll likely need to look into either using individual frames or researching gif use for animations. Movement, I need to learn the x and y restrictions of the screen.
Tomorrow I’ll hopefully have the first working iteration, where I’ll have my little guy walk around randomly (and hopefully not off screen). Then I’ll work on interactions with him, such as booping or maybe dragging him across the screen.

0
Olo the Fox

I decided to start my project in python. I’m unfamiliar with the syntax in comparison to Java, but I’m learning it to expand my library of coding languages.
Today I started learning about python’s built in GUI which has a lot of resources to learn from. I made a simple iteration of my program so far; Booping, which changes the face! I’ll likely dive into images or making it move across the screen tomorrow.

0