Share your repls and programming experiences

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

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.

syc1 (23)

bank = -10000;
boom i won

potatojs (801)

i hacked the game using the console lol

ridark (87)

Lookee at this:

Its nothing...

ZDev1 (638)

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


11ma (3)

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

MarblesAndMore (54)

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

Great game!

VulcanWM (2175)

That's definitely changing the code. Thanks @MarblesAndMore

MarblesAndMore (54)

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

VulcanWM (2175)

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

MarblesAndMore (54)

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

MatthewXia (25)

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

CarlosRosiles (183)

Nice! And congrats in 2k cycles!

userSM (219)

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

VulcanWM (2175)

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 (219)

@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.

VulcanWM (2175)

You've definitely changed the code @PowerCoder

PowerCoder (617)

@VulcanWM This game is very hackable

VulcanWM (2175)

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

aguy11 (119)

@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 (2175)

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

VulcanWM (2175)

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

aguy11 (119)

@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 (183)

@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 (638)

@aguy11 no no no no

function somefunc(name){
window.onload = somefunc('creeper aw man')
aguy11 (119)

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

VulcanWM (2175)

That is good! Imma add it @aguy11

aguy11 (119)

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('[email protected]&display=swap');
VulcanWM (2175)

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 (2175)

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

ZDev1 (638)

well good javascript
also styling

ZDev1 (638)

@VulcanWM np
if you want any help just ping me

EpicGamer007 (560)

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