From My Utter Boredom, I Created a Game to Irritate People

GOOD DAY! Today, Jul 30, 2024, I want to share a little project I whipped up out of boredom. It's a game called PICK, inspired by my mom, who used to pick up sewing needles I'd scatter on the floor. She always said it was quite a task to gather them all, so I thought, why not turn it into a fun game? Let's dive into the details!

Checkout my Github
Overview

PICK is a simple SwiftUI game where the objective is to drag and collect needles on the screen. The game tracks your score and allows you to progress through levels by doubling the number of needles after each successful round. I managed to build the core functionality in about 1-2 hours, with another hour spent tweaking the UI.

PlayView.swift
PlayView Screenshot

The main view of our game handles the display of the score, the level, and the needles. It uses @State and @AppStorage properties to track the game's state, including the score, level, and number of picks. The view updates dynamically to show a congratulatory message when you collect all the needles and a button to move to the next level.

This view handles each needle on the screen. It uses drag gestures to move the needles and updates the score when a needle is dragged far enough. The animation and interaction provide a smooth and engaging user experience.

Needle.swift
Needle Screenshot

This file defines the appearance of each needle using SwiftUI shapes like Rectangle and Triangle. Each needle is randomly positioned and rotated to make the game more interesting and visually appealing.

Icons and UI Elements
Pick Icon

The game displays the level and score using text elements and showcases the design of each needle with random positioning and rotation.

Pick More UI
Pick More UI Screenshot

When you collect all the needles, the game shows a "Pick More" button. Clicking this button doubles the number of needles and advances you to the next level.

App Storage

The game uses @AppStorage to save the level and the number of picks, allowing you to resume your progress even after closing the app.

Support for All Devices

The game supports various devices, ensuring a consistent experience whether you're playing on a Mac, iPad, or iPhone. The layout and interactions are optimized for different screen sizes and orientations, providing a seamless experience across all Apple devices.

Conclusion

I had a lot of fun creating this game and hope you enjoy playing it. It was a great exercise in SwiftUI and a nice way to turn a simple idea into a working application.