Inspiration

Starknet Ninja was inspired by the thrill of fast, tactile arcade play and the permanence of on-chain achievements, bridging familiar slice-and-score mechanics with the ownership and transparency of Web3. The goal was to create a lightweight, pick‑up‑and‑play experience that still showcases modern Starknet tooling, wallets, and NFTs in a way that feels intuitive for both gamers and crypto‑native users. By coupling moment‑to‑moment skill with a lasting on-chain record, every great run becomes a collectible memory.

What it does

Starknet Ninja is a token-slicing game where players slash flying tokens, avoid bombs, and build combo multipliers to climb their personal bests. After each session, players can mint their performance as an ERC‑721 NFT that encodes score, max combo, tokens sliced, bombs hit, game duration, and timestamp on Starknet Sepolia. Wallets like Braavos and Argent X connect seamlessly, letting players move from gameplay to minting and collection with minimal friction.

How I built it

The frontend is built with React 18 and custom hooks that manage game state, gesture-based slash detection, timing, and combo logic while keeping the render loop smooth and responsive across devices. On-chain, Cairo 2 contracts implement an ERC‑721 for achievements, with Scarb for builds and Starknet Foundry for declares, deploys, and iteration on Sepolia. Starknet.js powers wallet connections and contract calls, while a small service layer encapsulates RPC interactions and ABI usage to keep the UI clean and maintainable.

Challenges I ran into

Designing precise, performant swipe and collision detection that feels fair across desktop and mobile required careful tuning of sampling rates, thresholds, and animation timing. Ensuring deterministic, verifiable NFT metadata from game results meant building a robust post‑game pipeline and clear edge‑case handling for disconnects and aborted sessions. Wallet UX, permissions, fee prompts, and network readiness, had to be streamlined so minting feels like an optional victory lap rather than an interruption.

Accomplishments that I'm proud of

The game delivers responsive, satisfying slicing with combo feedback that feels snappy and consistent, even on lower‑end devices. Achievement NFTs mint reliably with clear metadata that reflects the exact run, turning high scores into durable on‑chain artifacts. The codebase is modular and approachable, hooks for game logic, a small service layer for Starknet, and a clean component structure, making new features and balancing easy to ship.

What I learned

Building for Starknet highlighted the importance of designing around latency and confirmation states, keeping gameplay fully client‑side while making post‑game on‑chain actions feel natural. Cairo 2 patterns for ERC‑721 and deployment tooling with Scarb and Foundry made iteration fast once a repeatable workflow was in place. Thoughtful wallet flows, from connection to transaction approval, are essential; small UX details dramatically affect conversion from “great run” to “minted achievement.”

What’s next for Starknet Ninja

Upcoming work focuses on community and progression: global and seasonal leaderboards, multiplayer and tournament modes, and collectible skins/themes that reward skill and engagement. A mobile-first pass and a React Native app are planned to optimize touch controls, along with mainnet deployment and token‑based rewards for sustained play. As features roll out, on-chain events will expand to support fair competition, anti‑cheat signals, and richer player profiles.

Built With

Share this project:

Updates