Giter Site home page Giter Site logo

hackerhgl / react-native-loop-game Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 12.0 13.41 MB

Clone of infinity loop game built with react native

License: MIT License

JavaScript 88.41% Starlark 1.84% Java 3.19% Ruby 2.62% Objective-C 3.95%
react react-native react-hooks react-native-animation react-native-game puzzle-game

react-native-loop-game's Introduction

React Native Loop

Features

UI Scaling
Scales UI on any size of device wether it be tablet, small screen mobile or phablet.
Offline-first
Run app without an internet connection. All assets are saved locally.
Simple UI
Just simple and straight forward UI.
Modularized Structure
Helps maintain a readable code, easy to fix and more room to add new features.
Open Source
Any piece of code is free to use anywhere except music you've to give credits to the creator in order to use them. Information can be found in app.

Requirements to run locally

Just in case if you ran into errors make sure you're using correct react-native & nodejs version.

  • Run npm run setup to install required global npm packages with correct versions.
  • Run npx jetifier to convert native libraries to AndroidX.
  • Run npm start to start the bundling server.
  • Run npm run android to build debug app for android.
  • Run npm run ios to build debug app for iOS.

Getting started with code

Please note that this project's code is not meant for beginners! If you're just getting started with React Native I recommend you to explore some ToDo and basic setState apps and get yourself familiar with react eco-system becuase in this project intermediate and advance implementations are use which will confuse you and won't help much in terms of learning.

  • init.js initialize default settings like styles, theme & API.
  • index.js initialize root components like Themes, Settings & Navigator.
  • configs/index.js holds app's & level's theme.
  • contexts/Settings/index.js is responsible for chaning/cache game's music track & volume.
  • contexts/Theme/index.js is responsible for chaning/cache app's dark/light mode.
  • engine is responsible for game's logic.
  • utils/index.js holds custom general functions.
  • utils/ui.js holds custom UI related functions.
  • utils/fonts.js
    • One of the fruits of using react-native is framework doesn't register custom font's weight automatically.
    • So in order to change font weight your to use complete font family name+prefix eg Muli-Bold.
    • This file helps us get correct font family name according to font weight.
    • Please also beware for iOS & android font family naming conflicts. READ MORE

Reason I didn't use redux is, App isn't heavily relied on shared state in between screen. Only shared data is theme mode & music controls which are implemented with context in few lines of code. So using redux seems like a overkill for this small scale project

Show support

If you like the project and want to appreciate my effort. Then please perform any of these steps :)

Download

License

This project is licensed under the MIT license, Copyright (c) 2020 Hamza Iqbal. For more information see LICENSE.md.

react-native-loop-game's People

Contributors

hackerhgl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.