Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How do i achieve this?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #235615
    maiki
    Participant

    so, i recently started working on a project. (this is not a csgo jackpot or stuff like that)
    What i need to do:
    There will be game rounds
    3 players in each round, ill need the name of the each player and deposit transaction
    When the round ends (when the round contain 3 players, or if there are only 2players a 30second timer will start) the winner will be picked.

    My questions:
    1. How do i go about organising my database?
    2. How do i achieve all this in PHP? (im thinking of sending ajax requests from index.php to specific php scripts

    If you dont understand what i want to do, check btcroll.com i want to do something similar to that. (The way the game works will be the same)

    #235618
    Alen
    Participant

    @maiki

    I don’t understand the rules of the game from the description you provided. I would suggest you take a moment and map out, on a piece of paper, what you need to do. Think about all the logic that needs to happen, plan everything out. From this you will have a better informed decision about what technology stack you need/want to use.

    In addition start with a PHP framework instead of building everything out yourself. Something like Laravel is more than capable of completing the task. Even something slimmer like Laravel Lumen, which you can use to abstract your API (AJAX) calls. Added benefit of PHP framework is most of them offer Migrations, it’s like Git for your database schema, it allows you to revert back changes to the database structure, super helpful.

    Hope that helps.

    Alen

    #235620
    maiki
    Participant

    @AlenAbdula hello, thanks for your reply and sorry for not being descriptive.
    First of all, have you check http://www.btcroll.com ? Thats what i want to do, basically:
    There’s a pool, Player1 adds lets say $3 bitcoin, Player2 will add $2 bitcoin and Player3 adds 5$ to the pool. The total prizepool is $10 bitcoin. When there are 3 deposits in the pool (aka 3players deposited money into the pool) the round will end and a winner will be choosen.
    Each player will be assigned a range of number (100numbers/$1), let say you’re the first player that deposits and you deposit $1, you will get the numbers from 0-100, 2nd players deposits $3, he will get numbers 101-400 and player3 deposits $2 and he’ll get the numbers 401 to 600. The whole range of numbers is from 0 to 600, i will do a random() function from 0 to 600, let say the number generated by the random() function is 53, Player1 owns the numbers from 0 to 100, 53 is part of them so Player1 is the winner.

    I have no single idea how would i go about managing my database, and manage the game engine, what i mean is, i dont really know how to find out when the round starts/ends and how to implement the 30 second timer when there are 2 or more players in the pool.

    If you still dont understand what i mean, take a look at btcroll.com , its basically the same idea with small modifications which ill make.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.