Share your repls and programming experiences

← Back to all posts
Bankrupt the Bank
VulcanWM (2152)

This is my second game in js: Bankrupt the Bank.

I originally got this idea while playing monopoly with my cousin. We kind of got bored giving each other rent, and teamed up to get all the money from the bank. When I lost all my game ideas, I remembered our game and based this on the game.

Most of my games are based on luck, and this one is as well. I got the idea of the cards from @Bookie0 's and @ChezCoder 's game 4 Chances.

Thanks @aguy11 for the logo on the card!

If you have any ideas on how this game could be better, comment below.

Commentshotnewtop
MarblesAndMore (53)

After a while, I was finally able to defeat the bank!

Great game!

VulcanWM (2152)

That's definitely changing the code. Thanks @MarblesAndMore

MarblesAndMore (53)

@VulcanWM What do you mean I didn't change the code?

VulcanWM (2152)

There is no way you can win like that! @MarblesAndMore

MarblesAndMore (53)

@VulcanWM I am honestly so bad at coding it would be almost impossible for me to do that.

MatthewXia (17)

@VulcanWM i won with -5 for the bank and like 1105 for me. i didn't change the code

userSM (194)

@VulcanWM, your profile picture is a times table Rock stars avatar, right?

VulcanWM (2152)

Bingo! Yeah, my friend had that avatar, and I kind of liked it. @userSM

octopyBot (263)

@userSM sry to necropost but its a pfp not avatar

userSM (194)

@octopyBot no his profile pic used to be different

octopyBot (263)

@userSM no I meant its not called an avatar its called a pfp. or profile pic. also I know that, to me it looked like scream? like the painting.

syc1 (23)

bank = -10000;
boom i won

potatojs (775)

i hacked the game using the console lol

ridark (52)

Lookee at this:

Its nothing...
@VulcanWM

ZDev1 (534)


Inspecting, running code in firefox console...
after a lot of functions, we I did it!

A LOT OF LOLs

11ma (3)

haha, i love playing monopoly, this makes me feel like i'm robbing the bank

CarlosRosiles (179)

Nice! And congrats in 2k cycles!

VulcanWM (2152)

You've definitely changed the code @PowerCoder

PowerCoder (617)

@VulcanWM This game is very hackable

VulcanWM (2152)

yh I know. Do you know a way I can make this unhackable? @PowerCoder

aguy11 (117)

@VulcanWM Make it all into one function so that you can't just call a certain function to hack it. That makes it less hackable, though hacking it's still possible.

PowerCoder (617)

@VulcanWM You can wrap the whole thing in an anoymouos function like so:

(function() {
})

This will call the anonymous function immediately after declaration.

VulcanWM (2152)

Do you know the code for it, cos I don’t know @aguy11

VulcanWM (2152)

Oh right, I’ll do that. Thanks! @PowerCoder

aguy11 (117)

@VulcanWM I don't really know JS, and it would be hackable anyway, but here's my prediction:

// This is really unnecessary and unorganized, but it's the best example I can give.
window.onload function game() {
// Basically do all of the stuff here(Even function declaring), so hackers can't reference a single part of the program and be done.
}

Yeah, this was a very short example.

Hope this helps!

CarlosRosiles (179)

@aguy11 I dont know why but I always add a

function supersecrethack() {
score = score + 10000000000000;
}

to my JS games. All you have to do is Ctrl + Shift + J and you enter this function into the console.

ZDev1 (534)

@aguy11 no no no no

function somefunc(name){
    alert(name)
}
window.onload = somefunc('creeper aw man')
aguy11 (117)

Maybe use this for the card logo? (Sorry, I'm not too good at art)

VulcanWM (2152)

That is good! Imma add it @aguy11

aguy11 (117)

This took me a few tries. You're getting better at non-hackable games.

I definitely didn't just hack:

You should use a different font. Maybe Oswald Light 300 from Google Fonts using the following import URL?

@import url('https://fonts.googleapis.com/css2?family=Oswald:[email protected]&display=swap');
VulcanWM (2152)

Sure thanks, I'll try that @aguy11

aruba (7)

You have successfully done the hard part, could you take the game to the next level, and play Chemin de fer, showing the bank and the players hand, and allow the player to stand or say "Banco"

VulcanWM (2152)

Maybe, I'm not that great at animations tho @aruba

ZDev1 (534)

well good javascript
also styling

ZDev1 (534)

@VulcanWM np
if you want any help just ping me

EpicGamer007 (420)

Good job! Can you give me the link to your first game(in js)?