Updated 15 days ago

PacRoyale

On-Chain Real-Time Gaming through Pac-Man, Winner Takes All

  • Crypto / Web3
  • Ethereum
  • L2
  • Crypto Gaming
  • Starknet

Inspiration

Inspired by the potential of Starknet and its use of Cairo and smart contracts, we’ve reimagined the classic Pac-Man game by introducing real-time gameplay and on-chain gambling. Unlike traditional turn-based games on Starknet, our game allows players to stake cryptocurrency to compete for a prize pool, with the winner taking it all. With the motto "Eat or be Eaten," players engage in fast-paced, blockchain-validated action, where every move counts. Our vision is to revolutionize on-chain gaming, combining the excitement of Pac-Man with the thrill of winner-takes-all gameplay, powered by Starknet's scalability and Cairo’s efficiency.

What it does

Our game offers an exciting, real-time, on-chain gambling experience where players compete in a fast-paced, Pac-Man-inspired environment. To join the game, players deposit PAC Coin, which is then scattered around the map. As players navigate the maze, they strategically choose their paths to eat PAC Coins, which are added to their wallet and increase their winnings. The stakes are even higher when players eliminate others—eating another player grants them all of their collected coins from the current game. "Eat or be Eaten" drives this high-stakes competition, where every move and decision can determine the winner. As a stretch goal, we plan to introduce power-ups that further enhance gameplay and give players additional ways to outsmart and outplay their opponents, turning this into a truly unique gambling game.

How we built it

We built the PacRoyale using Starknet, leveraging Cairo for smart contracts, and Typescript, React, and Vite for a fast, responsive frontend. The project includes three smart contracts: Pak token, USDC, and the game itself—all written in Cairo. The game is fully on-chain, with real-time updates for logic such as power-ups, collisions, and the gameboard, enabling a seamless, decentralized gaming experience. We're pushing the boundaries of on-chain gaming by creating real-time multiplayer interactions, inspired by on-chain projects like Minecraft. Using StarknetJS, we streamline transaction processes, eliminating the need for manual approval each time, making the interaction with the blockchain smoother. This approach showcases the potential of blockchain for real-time, interactive gaming, offering a unique and groundbreaking experience in the space.

Challenges we ran into

During the competition, we encountered significant challenges with Giza, as it was outdated and no longer supported in Starknet. This issue derailed our original plan, which was already halfway completed. Additionally, we faced difficulties with Cairo, the language we had relied on, which proved to be more complex than anticipated and hindered our progress. Despite these setbacks, we were determined not to let them define our project. We quickly pivoted, redefined our vision, and adapted our approach to ensure that our impact was still meaningful and achievable. This flexibility allowed us to continue innovating and stay on track.

What we learned

Through this experience, we gained valuable insights into Cairo, Starknet, and ZKML, as well as the complexities of building a game on the blockchain. We learned how to navigate the unique challenges of the Starknet platform, especially in the context of real-time gaming—a space not often explored. This journey deepened our understanding of the potential these technologies offer and the significant impact they can have on developers. We also recognized the value of flexibility and perseverance, as these tools allow us to push the boundaries of innovation and create groundbreaking solutions.

What's next for Pac Royale

For the next steps in the PacRoyale, we plan to enhance the core concept of the Pacman game by expanding the in-game rewards system and broadening player interactions. Currently, players compete in real-time by contributing a single coin to a pool, but we aim to introduce more diverse in-game rewards and assets that players can earn and use. We’ll focus on improving multiplayer dynamics, refining gameplay mechanics, and ensuring smooth and responsive interactions. Additionally, we will optimize the blockchain integration to make transactions even more seamless, all while keeping the game exciting, engaging, and innovative in the blockchain gaming space.

Built With

Built primarily with Starknet for its scalability and efficiency, and powered by Cairo for smart contract development, our game leverages the capabilities of blockchain to create a seamless, on-chain experience. USDC is integrated for secure and stable cryptocurrency transactions within the game. The frontend is designed with TypeScript for enhanced development and TailwindCSS for responsive, sleek UI styling. This combination of technologies ensures a smooth and efficient user experience while showcasing the potential of blockchain in real-time, multiplayer gaming.