Git Product home page Git Product logo

adcap's Introduction

Adventure Capitalist Game

This game was built on React + Redux. It was inspired from http://en.gameslol.net/adventure-capitalist-1086.html

This game is responsive, so it works on Desktop, Tablet and Mobile.

Demo

https://than1089.github.io/adventure-capitalist/

Dependencies

This game has minimum dependencies, no 3rd UI or game engine

  • React
  • Redux
  • uuid

Installation

yarn install
yarn start

Technical explanation

This game has multiple busnesses. With managers, each business will be able to run independently and automatically.

The approach is to use State Mangement - Redux along with React to build components, all logics rely on the store state. Ex: which businesses, managers are available; increase/decrease total earning by events.

This game is only front-end, there can be a back-end part for users to play on multiple devices without losing data in the to-do features.

Available businesses and managers

Available businesses and managers are calculated simply by comparing their price to total earning.

Count Down and Progress Bar

They are calculated by Date object of JavavaScirpt, so it's more accurate.

I was trying with setInterval with 1000 miliseconds for the CountDown, and CSS3 animation for the Progress Bar. But they are not reliable.

How to run businesses automantically with managers

When the countdown reaches zero, the Business component will check if it has manager and triggers a new run.

Continuous Progress when leaving

The app will cache the state and leaving time when the user closes the game. When going back, the latest state will be loaded, check src/redux/store.js

Based on current time and close time, we can calculate the earning. See src/utils/game.js

The running businesses in the middle will be kept. Ex: you have a business with 1 hour taken time. It already run 30 mins. If you close the browser for 15 mins, when getting back you will see the progress at 45 mins

To-do features if I spend more time on this project

  • Buy X3, X10, X100 and Buy Max.
  • Design game assets, images. I only use css to style this game, but it's better to have graphic design to help the game looks more attractive for users.
  • Implement login with Facebook and post data to back-end when leaving, so users can play on multiple devices without starting from the beginning on a new device.

adcap's People

Contributors

than1089 avatar

Watchers

 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.