Skip to content

Repository files navigation

Casino

What is this Project?

This is my apprentice project, which I started at the beginning of my apprenticeship. The Project started as a Terminal based application and has been developed to a web app since then.

The purpose of the Project was to come in touch with basic things like first programming languages (Python, HTML, CSS, JavaScript), vim/nvim, Git/GitLab (also Workflow) and later with a first Framework (Flask).

As you've propably already seen, the project revolves around a "Casino", well more or less, because the only thing you can do is play on a slot machine. You're playing with virtual currency, meaning there is no way of losing or winning any real life currency.

The Project isn't flawless and completely finished. I just brought it to a state, where it can be left to begin with a new Project.

Nevertheless, Feedback, Issue reports as well as Improvement Ideas are still very welcome and can be done over GitLab Issues or by contacting me gregoryk over Mattermost/Email.

How can you play the Game?

Locally:

    You can clone the repo and just run the docker compose file with "docker compose up", but before that you have to create a .env in the casino directory and set the variables MARIADB_USER_PASSWORD, MARIADB_ROOT_PASSWORD and SECRET_KEY.

Visit Website:

    I deployed the Project on a VM, which runs on an intern server.
    You can reach the Website over 10.202.99.108 or http://vm-gregoryk-casino-web-01.tux42.ch/ and http://casino.tux42.ch
    NOTE: You have to be connected to the adfinis vpn to access the Website.

About the Game itself:

    There is no user authentication, you only need the username to log in.
    How it works is: You give a username, if it exists you log into the account with that username, otherwise it creates a new user.
    NOTE: accepted characters are: a-z, A-Z, 0-9, _

    There are different game_modes in the game:
        - Normal: 
            Starting Money: 25'000 GKcredits
            Winning Combinations: 
                3/3 or 2/3 numbers are the same (555 or 343). If you get 3 different numbers like 584 then you get 5% back but still lose credits (because of your moneybet).
                If you get 777 you get the Jackpot.
            Losing Money:
                You can only lose as much as your bet is. The loss is your bet so if I place 100 and win 200 (moneybet * 2) I only make 100 GKcredits profit.

        - Hardcore:
            Starting Money: 300'000 GKcredits
            Winning Combinations:
                Same as in the Normal mode.
                You can also win the Jackpot with 777.
            Losing Money:
                You can lose Money additional to your Moneybet if you get 3 different numbers.
                If you go all in you better be sure that you win, because your bank account won't be able to recover if you don't.

        - Troll:
            Starting Money: 2'000 GKcredits
            Winning Combinations: 
                Reverse Psychology - the worse the numbers the more you win.
                You only win money if all the numbers are different.
                If you get 111 you've hit the jackpot.
                But hit 777 and you hope you never played the troll mode.
            Losing Money:
                Think you were lucky because you got 3/3 or 2/3 matching numbers? Congrats - your bank account just filed for bankruptcy.

    If you want to see more in detail how big the multipliers are you can have a look at the config.py file in casino_web/static.
    The Game is based on the principle of high risk high reward especally in the Hardcore and Troll mode. Meaning if you bet a greater amount the multiplier also gets bigger.

    After you select a gamemode you can click on the plus icon to create a new savestate, name it whatever you want just remember there is a limit for characters.
    NOTE: There is also a limit for Savestates. Every account is limited to 10 Savestates per Game mode.

    When you've created the Savestate there will already be Money on there, this is your starting capital, from now the only way to get Money is to Gamble.

    Don't remember which savestate was which? No problem just click on the Balance and you will see your career stats as well as your bought Items.

    Items:
        - Golden Ticket:
                - The Golden Ticket is the only Item, which has charges. And so you can decide when to use a charge of the Golden Ticket, I made an Activation/Deactivation Button. The Button is located on the Golden Ticket in your Inventory.

        - Golden Toilet:
                - The Golden Toilet is also a little more special, because it is the only Item, which has both the Profit Multiplier as well as the Luck modifier, but unlike the Golden Ticket the Golden Toilet can be used infinite Times.

        - All the other Items:
                - On the other Items there isn't much to note, some of them influence the luck factor, which makes you get better numbers and others influence the profit you get by multiplying it. All these Items can be used infinite Times.

    Luck/Profit Modifier:
            - Profit Modifier:
                    - The Profit modifier works like this, that the numbers get generated and then the modifier just multiplies with the Profit.

          - Luck Modifier:
                 - The Luck modifier works like this, that depending on how much the luck factor is lets say you get +300% luck because of some Items means that the numbers get generated 4 Times (1 time default and +3 for the Items) and then the numbers with the biggest profit get chosen.


    Now that you're Informed how the Game works, what are you waiting for? Time to gamble your way to the top.

About

This is a Project made with Flask

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages