A modern template to jumpstart your game development with React Native using the react-native-game-engine library and TypeScript. Includes a complete "Balloon Pop" example game. Uses Expo 53, React 19, and has web support.
- Node.js (18+)
- Expo CLI or
npx expo
- eas-cli (for building and submitting your app using EAS Build and EAS Submit)
- Expo SDK: 53
- React: 19
- React Native: 0.79.6
- TypeScript: Strict mode with path mapping
- ESLint: Configured for TypeScript + React
- Cross-platform: iOS, Android, and Web support
Clone the repository to get started:
git clone https://github.com/nightness/react-native-game-engine-expo-typescript-template
cd react-native-game-engine-expo-typescript-template
Install the dependencies:
npm install
Run TypeScript type checking:
npm run type-check
This project uses expo-dev-client
to enable a more integrated development workflow, allowing you to build and run your app on simulators/emulators with hot module reloading and access to developer tools.
The expo-dev-client
allows you to create custom builds of your application for development purposes.
To create a development build for each platform, run the following command:
-
For iOS:
npm run build:dev
This command generates a
.tar.gz
file containing an "app folder". Extract this folder and drag the app binary into your iOS Simulator to install it. -
For Android:
npm run build:dev
For Android, this command generates an APK file that can be installed on your emulator or physical device. Drag and drop the APK file into your Android Emulator to install it.
After building and installing the development client, you can open your project directly from the simulator/emulator. The Expo development menu can be accessed within the simulator/emulator, enabling you to use features like live reloading and debugging.
After installing the development build on your emulator/simulator, you can run the project using the npm start
command. This will start the Metro bundler and enable you to load and test your app with the development build just installed.
Start the project using the Expo dev client:
npm run start
To run the game on a specific platform, use the corresponding script:
npm run android # for Android
npm run ios # for iOS
npm run web # for Web (with react-game-engine)
assets/
: Static assets including custom SVG componentsSVG/
: Custom game SVG components (BalloonSVG, QuitSVG)
game/
: Core game logic and typesentities/
: Game entity components and factory functionssystems/
: Game engine and loop logictypes.ts
: TypeScript interfaces and type definitionsglobal.d.ts
: Global type declarations
types/
: Additional TypeScript declarations (react-game-engine)- Configuration files:
tsconfig.json
,.eslintrc.js
,babel.config.js
This template includes a complete example game to demonstrate the architecture:
- Gameplay: Touch/click balloons before they hit the ground
- Scoring: +1 point for each balloon popped, -1 for missed balloons
- Features: High score tracking, game states (start/playing/paused), quit confirmation
- Cross-platform: Works on mobile (touch) and web (mouse clicks)
- Physics: Matter.js integration for realistic balloon movement
- Study the Example: Review the Balloon Pop implementation to understand the architecture
- Replace Game Logic: Modify
game/entities/entities.ts
to define your game entities - Update Game Loop: Edit
game/systems/GameLoop.ts
for your game's update logic - Create New Entities: Add entity components in
game/entities/
following the pattern - Add Assets: Replace or add SVG components and other assets
- Update Types: Modify
game/types.ts
for your game's data structures - Customize UI: Edit
game/systems/GameEngine.tsx
for your game's interface - Test & Build: Use the provided build scripts for development and production
The eas.json
file is configured with profiles for local, development, preview, and production builds:
build:adhoc
: Build a local adhoc app binary locallybuild:dev
: Build a development client app binary locallybuild:preview
: Build for preview channelbuild:production
: Build for production channeleas:preview
: Build and submit to preview channel automaticallyeas:production
: Build and submit to production channel automaticallysubmit:preview
: Submit app to preview channelsubmit:production
: Submit app to production channelupdate
: Push over-the-air updates without app store resubmission
npm run build:adhoc # Build for physical device testing
npm run build:dev # Build for Expo development client
npm run build:preview # Build for preview
npm run build:production # Build for production
npm run eas:preview # Build and submit for preview
npm run eas:production # Build and submit for production
With EAS Update, you can keep your app up to date without waiting for app store reviews:
npm run update # Auto-update
npm run update:preview # Update the preview channel
npm run update:production # Update the production channel
- ESLint: Pre-configured with TypeScript and React rules
- TypeScript: Strict mode with path mapping for clean imports
- Cross-platform: Shared game logic works on mobile and web
- Hot Reload: Fast development with Expo dev client
- Matter.js: Physics engine integration for realistic game mechanics
File issues on the repository issue tracker.
Contributions are welcome. Please fork the repository and submit a pull request.
This project is licensed under the MIT License.