💡 Inspiration

The inspiration behind Plastic Punk Retro stems from two major influences: a deep concern for the global plastic pollution crisis and a nostalgic love for retro simulation and strategy games like SimCity, Theme Hospital, and classic tycoon titles.

Every year, millions of tons of plastic waste enter our oceans, destroying ecosystems and impacting human health. While awareness campaigns exist, we felt that dry statistics often fail to engage people on an emotional level. We wanted to create something that gamifies environmental consciousness—not by lecturing the player, but by letting them experience the strategic complexity of ecological restoration firsthand.

The term "Plastic Punk" represents a spin on the classic "cyberpunk" genre. Instead of a dystopian future dominated by high-tech corporate oppression, Plastic Punk represents a world grappling with the physical and environmental debris of the synthetic age, where the "punks" are the eco-engineers, community organizers, and scientists working to reclaim the Earth. By packaging this message in a charming, nostalgic 8-bit aesthetic, we make a heavy subject approachable, engaging, and fun.

🕹️ What it does

Plastic Punk Retro is a fully interactive, cross-platform eco-strategy game where players take charge of cleaning up highly polluted regions.

Upon launching a level, players are presented with an isometric grid map divided into land, water, and various types of contamination (plastic piles, toxic runoff, oil spills). To succeed, players must balance economic growth with environmental remediation using a variety of tools:

  1. Remediation Infrastructure: Players build structures such as Water Treatment Plants to purify rivers and oceans, Recycling Factories to convert plastic debris into spendable credits, and Solar Arrays to generate clean energy.
  2. Resource Management: Every action costs money or energy. Players must build a self-sustaining economy where recycling generates revenue, which is then reinvested into more advanced cleanup systems.
  3. Active HUD & Eco-Metrics: A dynamic HUD monitors global pollution index, energy levels, and funds. If the pollution index hits 100%, the ecosystem collapses, resulting in a game over.
  4. Research & Development: The technology tree allows players to research advanced recycling methods, reduce carbon footprints, and increase the efficiency of their cleanup buildings.
  5. Diplomatic Missions & Narrative: The game includes interactive dialog campaigns. Players must coordinate with neighboring cities to clean up cross-border pollution, negotiate budgets, and respond to environmental disasters.
  6. Cloud Sync: Progress is automatically saved locally using shared_preferences and synced to the cloud via Firebase Firestore, ensuring players never lose their progress across devices.

🛠️ How I built it

Building a real-time simulation game on a cross-platform framework required a modern, highly efficient technology stack:

  • Flutter & Flame Engine: Flutter served as the core framework, providing a smooth UI container, while the Flame Engine powered the 2D game loops, rendering pipeline, asset loading, and sprite updates.
  • Tiled Map Editor & Flame Tiled: All game levels were designed in Tiled. We configured custom isometric projections, layer hierarchies, and trigger objects. The maps are dynamically parsed at runtime using flame_tiled.
  • Riverpod for State Management: Game simulation involves complex state changes (e.g., building a factory increases energy usage, which updates the HUD, which changes the available options in the build menu). We used annotation-driven Riverpod (riverpod_generator) to manage this state reactively. The Flutter UI and the Flame game loop communicate seamlessly through these Riverpod providers.
  • Firebase Integration: We used Firebase Auth for anonymous and email-based player authentication, and Cloud Firestore to store player save states, unlocked technologies, high scores, and achievement matrices.
  • Audio Pipeline: flame_audio was integrated to play continuous 8-bit background chiptunes and trigger responsive SFX for building placement, research completion, and menu clicks.

🚧 Challenges I ran into

Integrating a high-performance game engine (Flame) with a reactive UI framework (Flutter) presented several architectural hurdles:

  • Bridging Flame and Riverpod: The Flame game loop runs independently of Flutter's build cycle. Passing real-time stats (like money and pollution) from Flame's update loop into Riverpod providers without triggering infinite build loops or lagging the UI was extremely tricky. We resolved this by using a custom state controller layer that debounces non-critical updates and only pushes UI-relevant state changes at fixed tick intervals.
  • Isometric Coordinates & Collision: Translating raw screen touch coordinates (Cartesian) into isometric grid coordinates for building placement was mathematically challenging. We had to implement custom coordinate transformation matrices and handle bounding boxes for multi-tile structures to prevent placement overlap.
  • Asset Management and Flutter Web: Web browsers handle image decoding and caching differently than native mobile apps. Initial attempts led to memory bloat and stuttering when loading the full sprite sheet. We optimized this by packing all tiles into a unified texture atlas, utilizing loadAllFromPattern during the splash screen, and caching assets locally to prevent network lag.
  • Offline Saving Synchronicity: Managing state when a player loses internet connection mid-game required a robust syncing algorithm. We created a local-first architecture where the game saves to shared_preferences instantly, queues the save event, and pushes it to Firestore once a stable connection is re-established.

🏆 Accomplishments that I'm proud of

  • Fluid Cross-Platform Experience: The game runs at a locked 60 FPS on Android, macOS, and Web platforms without any platform-specific code branch differences.
  • Deep State Synchronization: We created a highly reactive HUD and build menu overlay in Flutter that reflects changes in the underlying Flame game world instantly.
  • Charming Retro Atmosphere: The synergy between the custom 8-bit pixel art, the custom Teko and 04B_30 typography, and the retro chiptunes creates a highly polished, nostalgic aesthetic that immediately hooks the player.
  • Strategic Depth: The balancing of the economy (energy vs. funds vs. pollution cleanup speed) works naturally, providing a genuine challenge reminiscent of classic strategy games.

📖 What I learned

  • Advanced Game Loop Architecture: I gained deep experience in separating rendering logic from game simulation logic, using tick-based updates to decouple heavy calculations from the render loop.
  • Isometric Vector Mathematics: Working on this project deepened my understanding of coordinate systems, specifically translation, rotation, and skew matrices required to project 2D assets into a pseudo-3D isometric perspective.
  • State Management in Hybrid Apps: I learned the limits of combining declarative UI state with imperative game loop engines, establishing a robust paradigm for Flame and Riverpod integration.
  • Optimization of Web Canvas Assets: I discovered the importance of image asset optimization, sprite sheeting, and garbage collection mechanisms on web browsers.

🔮 What's next for Plastic-Punk-Retro

We have big plans to expand the game into a fully-featured simulation experience:

  • Procedural Map Generation: Instead of fixed pre-designed levels, we want to build a procedural generator that creates unique coastlines, pollution distributions, and resource nodes for infinite replayability.
  • Weather and Seasonal Dynamics: Introducing environmental variables like storms (which increase ocean plastic movement), droughts (which reduce water treatment efficiency), and clear days (which boost solar panel production).
  • Real-Time Community Events: Global leaderboards and cooperative campaigns where players combine their recycled resources to unlock global upgrades and restore planetary health.
  • Deeper Diplomatic Decision Tree: Expanding the narrative mechanics to include moral dilemmas, corporate negotiations, and public relations campaigns that affect citizen happiness and funding.
  • Mobile App Store Launch: Packaging the game for a formal release on the Google Play Store and iOS App Store.

Built With

Share this project:

Updates