Mobile Game

Block Puzzle Play

Block puzzle game with 8×8 board, native drag & drop at 60 FPS, async 1v1 duels, daily challenges with global ranking, strategic power-ups, and complete progression system. Offline-first architecture with Event Sourcing.

Published on App Storev1.0.4 — iOS + Android

35+

Unique pieces

8×8

Board

5

Game modes

15K+

Lines of code

19

SQL Functions

v1.0.4

Version

Features

Key Features

Core Gameplay

8×8 Board with Drag & Drop

Responsive grid with native gestures and real-time ghost preview showing where the piece will land before releasing.

35+ Unique Pieces

Lines (2-5 cells), squares, L, T, S, Z shapes, corners and cross. Multiple rotations, classified by difficulty.

Complete Game Engine

Complete line detection, game over with early exit optimization, piece reload (3 new when all 3 placed).

Combos & Multipliers

Scoring that rewards clearing multiple lines (x1 to x4) and maintaining consecutive combos (up to +50% bonus).

Game Modes

Classic

No time limit. Maximize score until no moves are possible.

Timed

Three variants (60s, 90s, 120s). Highest score before time runs out.

Zen

Relaxed mode without time pressure. Meditative experience (premium feature).

Daily Challenge

Same pieces for everyone (deterministic seed). Global and friends ranking. 1 attempt per day.

Social & Duels

Async 1v1 Duels

Challenges between friends with same seed for fairness. Side-by-side result comparison.

Friends System

Unique friend codes, list with online status, weekly rankings among friends.

Share Results

Generated image with score, lines, max combo, and streak for social media.

Power-ups & Progression

Strategic Power-ups

Bomb (clears area), Undo (returns last piece), Ghost Preview (optimal position 3s).

Complete Economy

Coins (score/10), variable XP by mode, daily streaks with streak shields, unlockable achievements.

Monetization

AdMob

Banner on Home, interstitial every 3 games (1 min cooldown), rewarded for power-ups, coins, and continue.

Premium Subscription

$1.99/mo or $9.99/yr: no ads, x2 coins, Zen mode, exclusive themes, streak shields, advanced stats.

Technologies

Tech Stack

Frontend / Mobile

React Native 0.81

New Architecture (JSI/Fabric)

Expo SDK 54

Build, deploy, OTA updates

TypeScript 5.9 + React 19

Static typing, hooks

Zustand 5

7 stores: game, auth, user, theme, premium, friend, duel

Reanimated 4.1

Native thread animations for drag & drop

Backend

Supabase

Auth, DB, Realtime, 3 Edge Functions

PostgreSQL

Schema blockpuzzle, 11 tables, 19 SQL functions

Public views (bp_*)

5 views as secure abstraction layer

Row Level Security

Per-table policies, schema not exposed

Services

Google AdMob

Banner, interstitial, rewarded

Firebase Crashlytics

Production crash reporting

EAS Build + Update

Cloud builds and OTA by channels

Local

AsyncStorage + Zustand Persist

Game, settings, sync queue

expo-secure-store

Encrypted tokens (Keychain/EncryptedSharedPrefs)

Main Libraries

react-native-gesture-handlerreact-native-reanimatedreact-native-google-mobile-ads@react-native-firebase/crashlytics@supabase/supabase-jsi18nextreact-i18nextexpo-linear-gradientexpo-apple-authenticationexpo-auth-sessionexpo-secure-storeexpo-avexpo-updatesexpo-localization
Design

Architecture Decisions

Isolated Schema with Public Views

blockpuzzle schema not exposed to client. 5 bp_* views as abstraction + RPC wrapper functions. Allows changing internal structure without affecting frontend.

Offline Event Sourcing

Actions recorded as local events, processed for instant UI, queued for sync with exponential backoff retry. Server wins on conflicts.

Zero I/O during Gameplay

Complete state in Zustand (memory). Autosave every 10s in background without blocking UI. Guaranteed 60 FPS.

Reanimated for Drag & Drop

Shared values on native UI thread, runOnJS only for business logic. Ghost preview without re-rendering the board.

Responsive with Tablet Cap

wp/hp/fs functions based on iPhone 13 mini (375×812). Width capped at 500px on tablets to prevent x2 scaling.

Deterministic Seed

Daily challenges and duels generate pieces with seeded PRNG: hash(date + "blockpuzzle"). Server-side seed validation.

Local-First with Optional Login

Full game without an account. On login, local data syncs with Supabase. Maximizes retention by eliminating friction.

Engineering

Technical Challenges

Drag & Drop at 60 FPS

Problem: Each finger movement triggered cascading re-renders, recalculating ghost preview and global state.

Solution: Separation of visual position (Reanimated shared values, native thread) from business logic (runOnJS). Refs for internal comparisons.

→ Constant 60 FPS even on low-end devices.

Cross-Device Responsive

Problem: On iPads everything scaled x2 because functions used real width (768-1024px) vs 375px base.

Solution: Centralized responsive.ts system with wp/hp/fs that caps width at 500px on tablets. 12+ screens migrated.

→ Consistent UI from iPhone SE to iPad Pro.

Offline Sync

Problem: Games, coins, and stats must sync without data loss after playing offline.

Solution: Event Sourcing with AsyncStorage queue, exponential backoff retry, server-wins for conflicts.

→ Zero data loss, transparent sync.

Efficient Game Over Detection

Problem: Checking if any piece fits anywhere: potentially 3 × 64 × N blocks.

Solution: Early exit on finding first valid position. Occupied positions cache.

→ Detection in <50ms, imperceptible to user.

App Store Approval (First Time)

Problem: Privacy templates, data safety, AdMob, Crashlytics, OAuth, Apple compliance.

Solution: Systematic approach: declaration of each data point, correct bundle IDs, app-ads.txt, age classification.

→ Approved by Apple on first review.

Status

Project Status

Completed

  • Supabase backend: 11 tables, 19 SQL functions, RLS, 3 Edge Functions
  • Game engine: boardEngine, pieceGenerator, scoreCalculator
  • 12+ screens, 14+ gameplay components
  • Auth: Google OAuth + Apple Sign-In
  • AdMob (3 types), Crashlytics, i18n (ES/EN)
  • 7 Zustand stores, 4 visual themes
  • Responsive for phones and tablets
  • Published on iOS App Store

Pending

  • Daily Challenge full frontend integration
  • Comparative result UI for duels
  • Functional leaderboards and achievements
  • Final Google Play publication (production)
  • Push notifications
  • Line clearing animations (polish)
Results

Key Achievements

Published on App Store — approved by Apple on first review

Full-stack end-to-end architecture: game engine, UI, PostgreSQL with RLS, Edge Functions, auth

Cross-platform with 100% shared code: React Native + Expo for iOS and Android

Async duels with deterministic seed — unique in the block puzzle market

Offline-first with Event Sourcing and transparent sync

Dual monetization: AdMob (3 types with rate limiting) + premium subscription with IAP

Responsive from iPhone SE to iPad Pro with centralized scaling system

Constant 60 FPS with Reanimated on native thread during drag & drop

Robust security: RLS, unexposed schema, encrypted tokens, anti-cheat with shadow bans

Details

Additional Information

Languages

Spanish + English

Themes

Dark, Light, OLED, Sepia

Modes

Classic, Timed, Zen, Daily, Duels

Architecture

Local-first, optional login

Arcade Palette — Piece Types

Lines

Squares

L-shapes

T-shapes

S-shapes

Z-shapes

Corners

Cross

Database — 11 tables

user_profilesuser_statsgame_completionsdaily_challengesdaily_completionsduelsdaily_rewardsweekly_scoressuspicious_activityevent_queueshadow_bans