Inspiration

We were looking for a way to build an application that is easy to play and entertaining with high stakes involved. That's when we saw that one of our laptops desktop was filled with icons. We wanted to gamify the most mundane part of a computer the desktop and turn it into a battlefield where the player has to physically fight to protect their data.

What it does

The Devil in Your Desktop is a transparent overlay game that takes place on your actual computer screen. Desktop Pets : A "Devil" character roams your screen, walking to your desktop icons and "eating" them by moving them into a hidden folder. An "Angel" character tries to chase the Devil and restore the files.

Fight Mode: The player can take control of the Angel to shoot projectiles at the Devil.

Wake Me Up Mode: A high-stakes, 60-second survival challenge designed to wake you up. You must kill the Devil before the timer runs out. If you fail, the "eaten" files are permanently deleted.

Revival Mechanics: In this mode, the Angel has unlimited revives but suffers a time penalty; if the Angel dies, the Devil heals 2 HP and vomits files back out, resetting his "weapon" progress, you must kill the devil within the time or stand to lose your files.

How we built it

Tech Stack: We used Python with PySide6 to create a frameless, transparent window overlay that sits on top of the desktop but below other windows.

Windows API Integration: To make the characters interact with real icons, we used ctypes and win32gui to read the memory of the Windows Desktop process (SysListView32).

File System Management: We used pathlib and shutil to safely move files between the desktop and a "stomach" directory, with a safe_mode failsafe to restore files when the game closes.

Challenges we ran into

File retrieval: When the angel killed the devil, we faced the difficulty of retrieving the files from his "stomach", which we spent hours figuring out a way to do so. Finally we used an API to retrieve the files from the desktop and recover the files back to the desktop.

Icon Coordinate Extraction: Windows doesn't make it easy to find where desktop icons are. We had to implement low-level memory reading using VirtualAllocEx and ReadProcessMemory to fetch the icon positions from the Windows Shell.

Accomplishments that we're proud of

Real-World Consequences: We successfully implemented a mechanic where losing the game has actual consequences (file deletion), creating a genuine adrenaline rush.

"Wake Me Up" Logic: We built a complex state machine for the "Wake Me Up" mode where the timer never stops even during revival animations, ensuring the pressure is always on.

Transparent Overlay: Getting the characters to render smoothly over the desktop without a visible window frame while maintaining click-through transparency where needed.

What we learned

Win32 API: We gained a deep understanding of how Windows manages desktop items and how to interact with OS-level processes programmatically.

PySide6 Graphics: We learned how to manipulate QPixmap and QPainter for real-time game loops and HUD updates.

Risk Management: Developing a game that can delete files taught us the importance of rigorous testing and failsafes (like the restore_all_files method) to prevent accidental data loss during development, we actually ended up with accidentally deleting some files permanently during a test run, which prompted us to develop the "wake me up" mode with a safe deletion to the recycle bin.

What's next for Desktop Pets Game

Instead of using a screen to delete the files, we will be implementing it directly on the desktop, so that the devil can walk over to the files and eat them. We will also be implementing a sorting algorithm to allow the angel to sort the desktop icons to different places of the laptop. Finally a permanent file deletion game mode for adrenaline junkies.

Built With

Share this project:

Updates