1.0.16 • Published 4 months ago

react-native-candy-game v1.0.16

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

React Native Candy Game 🍬

A simple match-3 style game (Candy Crush-style) built using React Native + TypeScript.

🔥 Features

  • 🎮 8x8 candy grid
  • 🧠 Match-3 logic (horizontal + vertical)
  • 🧾 Scoring system
  • 🕐 Time limit per level
  • 📈 Multiple levels with increasing difficulty
  • 🗨 Multilingual text support via props
  • 💾 Score & level saving with AsyncStorage
  • ⏳ Mini splash screen with optional text translation
  • 🍬 Bonus candies (row and column destroyers)

📦 Installation

npm install react-native-candy-game

📱 Basic Usage

import { CandyGameScreen } from 'react-native-candy-game';

<CandyGameScreen
  level={1}
  translations={{
    scoreLabel: 'Рахунок',
    timeLeftLabel: 'Час',
    finalScoreLabel: 'Підсумковий рахунок',
    gameOverText: 'Гра завершена!',
    loadingLevelText: 'Завантаження рівня...',
  }}
  onScoreSaved={(score) => console.log('Score:', score)}
/>

🌍 Multilingual Support

All UI texts can be translated via the translations prop:

Prop KeyDefault (English)
scoreLabelScore
timeLeftLabelTime Left
finalScoreLabelFinal Score
gameOverTextGame Over!
levelCompleteTextLevel Complete!
nextLevelTextNext Level
retryTextRetry
loadingLevelTextLoading your level…

🔁 Level Persistence

  • The game remembers your last level using AsyncStorage.
  • Automatically resumes from the saved level on app launch.

📂 Optional: Use Level Selector with Navigation

import { CandyGameScreen, LevelSelectScreen } from 'react-native-candy-game';
import { createStackNavigator } from '@react-navigation/native-stack';

const Stack = createStackNavigator();

<Stack.Navigator>
  <Stack.Screen name="LevelSelectScreen" component={LevelSelectScreen} options={{ title: 'Choose Level' }} />
  <Stack.Screen name="CandyGameScreen" component={CandyGameScreen} options={{ title: 'Candy Game' }} />
</Stack.Navigator>

💡 Bonus Candies

Special candies randomly appear during the game:

  • 🍬 Row Destroyer Candy – clears entire row
  • 🍬 Column Destroyer Candy – clears entire column

Customize their images in assets/bonus_row.png and assets/bonus_col.png.

🎥 Gameplay Preview

Include a .gif file showing gameplay if desired.

📫 Contributions

Pull requests, issues, and feedback are always welcome. Let's make this game better together!

1.0.16

4 months ago

1.0.15

4 months ago

1.0.14

4 months ago

1.0.13

4 months ago

1.0.12

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago