A thrilling tower climbing game built on Solana blockchain where players stake tokens to climb a tower and win bigger rewards!
Tower Gamble is a simple yet addictive game where players:
- Stake tokens to start climbing a 10-floor tower
- Each floor has a 49% chance of success (51% house edge)
- Players can cash out at any time to secure their winnings
- Payouts increase exponentially with each floor climbed
- Reach the top for maximum rewards!
- Frontend: Next.js 15 with React 19
- Styling: Tailwind CSS + Shadcn UI
- Blockchain: Solana Web3.js
- Wallet: Solana Wallet Adapter
- Language: TypeScript
-
Clone the repository
git clone <repository-url> cd solana-game
-
Install dependencies
npm install
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
- Connect Wallet: Click "Connect Wallet" and connect your Solana wallet
- Set Stake: Use the slider to set your stake amount (0.1 - 100 tokens)
- Start Game: Click "Start Game" to begin climbing
- Make Decisions: At each floor, choose to:
- Ascend: Risk it all for higher rewards
- Cash Out: Secure your current winnings
- Win or Lose: Each ascent has a 49% success rate
- House Edge: 51% (49% player win rate)
- Floors: 10 total floors
- Multiplier: 1.5x per floor
- Stake Range: 0.1 - 100 tokens
- Payout Formula:
stake × (1.5 ^ floor)
Game settings can be modified in src/lib/config.ts:
export const GAME_CONFIG = {
name: 'Tower Gamble',
houseEdge: 51,
minStake: 0.1,
maxStake: 100,
maxFloors: 10,
baseMultiplier: 1.5,
} as const;- Responsive Design: Works on desktop and mobile
- Real-time Updates: Live game state updates
- Game History: Track your recent games
- Wallet Integration: Seamless Solana wallet connection
- Toast Notifications: User-friendly feedback
- Progressive Web App: Installable on mobile devices
- Implement actual Solana program for on-chain randomness
- Add SPL token integration
- Create leaderboards
- Add sound effects and animations
- Implement multiplayer tournaments
- Add achievement system
This is a demo version using client-side randomness. For production use, implement:
- On-chain Solana program for verifiable randomness
- Proper token escrow mechanisms
- Audit smart contracts
- Implement proper access controls
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.