rzhevskyrobotics / durka_game

A clicker game on PIXI.JS for Telegram Web App and TON Blockchain. Enjoy:)
MIT License
13 stars 11 forks source link

how install ? #1

Open bykuin opened 5 months ago

bykuin commented 5 months ago

hello how install

rzhevskyrobotics commented 5 months ago

Hi! Sorry for the late response, I'm really swamped with work(( So, the game is an application for Telegram Mini Apps(https://core.telegram.org/bots/webapps). Essentially, it’s just a web application with a Telegram library(https://core.telegram.org/bots/webapps#initializing-mini-apps) for interacting with users within Telegram. The main logic is implemented in JavaScript using the PIXI.JS library for graphics. The code is quite simple! I hope so))) So the installation process depends on how you want to use it:

Option 1 - Run the game locally

The best approach is to write a simple web server that can serve the resources (html, css, js, etc. - all located in the src/frontend folder) upon request. Then, you can access the game at http://127.0.0.1/ or something similar in your browser. The game will run, but:

  1. It won't be able to connect to Telegram, retrieve user data, etc.
  2. It won't be able to save data to a database, which means you won't be able to buy boosters in the game, and so on.

However, for the purpose of studying the code, this should be sufficient. Important - check that the settings in the src/frontend/js/main.js file are set to const IS_DEBUG = true and const IS_DEBUG_NEED_SYNC = false; This way, the application can run without needing to connect to Telegram.

Option 2 - Run the game as Telegram Mini App

This option isn't much different from the previous one, except that you'll additionally need to:

  1. Write a web server with a database for storing game metadata (you can rewrite the code to save data only within Telegram using their cloud; see the documentation link provided earlier) and to serve the game's resources.
  2. Write a bot application for Telegram. It should provide the user with a link to the application upon request.

We implemented this in Go (see src/backend).

In short, that's it :) I'll try to upload a guide in the readme later. If you have any questions, please feel free to reach out! If I can find the time, I'll definitely help. Thanks for your interest in the game! :)

P.S. We would be very grateful if you could take a moment to vote for us in the hackathon :) https://dorahacks.io/buidl/13659