Share your repls and programming experiences

← Back to all posts
The Fishing Game again
AmeliaBlackwell

Hi guys, I made this game a couple of years ago now. There was always a problem with the database. Now that repl.it have rolled out in=built databases, I made this version which I think actually works. However the database is only personal to your repl, and not shared amongst users, so things like the highscores board will only show any runs of the game that you have done. I really hope it actually works for more than a few weeks this time! Comment if you run into any problems! Thank you so much for playing!

The Fishing Game

Explore your way through the different regions by catching the rarest fish you can. Catch em all to fill up your fishedex!

Hi!! This my fishing game. Here's a bit of an explanation that you also get ingame:

Welcome to my fishing game! The aim of the game is to reach level 100 as quickly as possible. Catch the rarest fish you can and level up! You can sell your fish in the shop. Rarer fish bring in more gold. You can use this gold to purchase bait, which is needed to catch fish, and rods, which make catching rarer fish easier. Careful, bait gets more expensive as you level up. New types of fish are unlocked as you level up, and at higher levels, it's easier to catch fish. You can also see information about all the fish you've come across in the 'fishedex' in the shop. Catch them all! You might also find some treasure when you're fishing! The game saves your progress at the end of each day, so you can just log in again and pick up where you left off. Good luck! Press enter to continue.

Not gonna lie, it's pretty fun.

Backstory

I made this game last July. The reason I choose fishing was mainly because it makes plurals easier - the plural of most types of fish is the same as the singular ;) (This doesn't work for anchovies though... or mythical creatures. Oh well). To make it I did have to learn a little about using classes and objects - I find them really useful now though. My coding's definitely developed a bit since I made this (it's a mess), but I can't really be bothered to make the code any neater (I did a tiny bit). I have edited it a bit since I originally made it to make it ready for the game jam.

To see the original Fishing Game post: https://replit.com/talk/share/The-Fishing-Game/12016

Voters
TotallyNotSeth
Orca20
DonoldJTrump
MorganHarringto
JOSHUASHOCKEY
VulcanWM
sojs
MikeJMS8910
alex-ep
VihaanM1
Comments
hotnewtop
MorganHarringto

Once you reach in 50-65 in that range is when the game starts to break and if you don't constantly save you will lose everything that is how i was able to get to 100+,I'm not sure if its a replit thing or maybe after you reach a certain point something in the code breaks, im still new to coding so im not sure.

Orca20

Still broken... at level 60-75 in beyond the wall it always just freezes...

Orca20

I keep having to start over :(

Orca20

This is still broken though... at about level 50 it always just freezes and deletes all your progress... So now I have to start allll over again :(

MorganHarringto

Lets go

AmeliaBlackwell

@MorganHarringto dude! well done! What happened when you went past level 100? (I'm checking game still works?)

MorganHarringto

@AmeliaBlackwell I was sent to a different zone and it allows me to catch mythical creatures but my rod broke almost instantly and i didn't have the gold to get a new one.If that is what your wondering the objective after 100 still works.

SilvermoonCat

I don’t THINK you did this but could you make a clear thing?
like

It’s a cool game tho :D

CodingElf66

There's an error for logging in, if you enter the wrong thing.

ARCTrooperAlpha

glitched at level78, day 278

TAL0S

It's back!!!

VulcanWM

went up to level 50 and some bug happened and it stopped-

AmeliaBlackwell

@VulcanWM oh no what did the bug say?

VulcanWM

there was no bug the screen just froze @AmeliaBlackwell

AmeliaBlackwell

@VulcanWM that's happened to me before i think it's just like repl.it

VulcanWM
alex-ep

Wow this is insane and is so cool. I'm new to python, how'd you make it able to save your date and log back in later? Also how long did it take you?

AmeliaBlackwell

@AlexEpstein Thank you so much! Well that's the part I struggled with. It's easy to do with IDLE on a computer, just using text files. Then you can write to and access text files within the program. Online like on repl.it it's harder. In this version I used the repl.it in-built database. It took me quite a while tbh, I first made the simplest version in 2018 which had only a few features. In 2019 I revamped it for the game jam competition. In 2020 I tried to fix the accounts saving system I used in 2019 which broke. And in the past week I've tried to fix the accounts saving system I used in 2020 which also broke lol. All in all I've probably spent about 50 hours working on it. The initial idea didn't take very long to build, but a lot of the subsequent features did!

alex-ep

@AmeliaBlackwell Amazing, I'm trying to understand it, I'm very new to python, so all the packages and 'poetry' installer things are so confusing. Also just wondering, what are the random portions of commented out text? I tested it out without them and the game worked fine.

AmeliaBlackwell

@AlexEpstein Idk what the poetry installer thing is. The packages that it actually uses are time (for time delays in text printing), random (for random selections), numpy (for mathsy stuff like distributions), sty (for the coloured text) and replit (for the database and clearing the output screen). And the commented parts are from previous versions. They're just there so I can refer to them. Comments don't affect code. Hope this helps. I'm happy to explain both the code and the game mechanics more if you want

alex-ep

@AmeliaBlackwell Thanks! I love the code and i'm trying to do the log in stuff where it saves it for next time, im using a json file with username and password. I also am doing the colored code with RgbFg, but also importing Style and using that, because I tried to use your cprint to print with colors, but it gave me some error about fg doesnt have attribute set_style or something like that, so I did it a bit differently. just spent 6 hrs today on it but i'm stuck on some things, I'm very inspired to make something like your game! Also, replit is a bit hard to talk on through these comments, Do you have anything like discord, because i'm super interested in coding and would love to talk about things! :)) if you want, my discord is Kooldood#0853.

LordPython404

Nice! I love it!

AmeliaBlackwell

@LordPython404 Thank you!

VulcanWM

wow uve posted after such a long time
The replit database doesn’t work in the console
You need a website for that (maybe using flask)
I could help if you want

AmeliaBlackwell

@VulcanWM Wdym console? It's working okay for me, but only with individual repls

Previous versions used a website, but the limited storage space couldn't cope with a game wide database

Could flask solve that problem?

Thanks for your help :)

VulcanWM

People who don’t have access to edit the repl don’t have access to edit the db
Hence it isn’t working for me
Yeah flask would definitely help as I’ve used it a few times for many of my games which involve a database
If you want me to help, just invite me to a forked version of your repl thanks @AmeliaBlackwell

AmeliaBlackwell

@VulcanWM okay I've invited you!

VulcanWM

so i added some main flask functions needed in the website and added some notes too
my brain is ded rn so i have no idea of which format you are storing the data in the database, so ive left u to do the database stuff
@AmeliaBlackwell

AmeliaBlackwell

@VulcanWM okay wait so what do i need to do? for a flask dummy

VulcanWM

so first of all do the login and signup function, ive set up getting the data from the html form so you juste need to do the db stuff for it
just do addcookie("User", [user_username]) after adding the function @AmeliaBlackwell

AmeliaBlackwell

@VulcanWM I don't understand exactly what you're saying, what do you want me to put and where exactly? I'm not sure if you just want me to copy code over to the app.py file or if you need me to rewrite it to fit with what you've done?

VulcanWM

Rewrite it to fit with what I’ve done @AmeliaBlackwell

VulcanWM

Just with the flask functions and stuff @AmeliaBlackwell

MrVoo

File databases never work, and replit database does not work on console projects. If you turn this into a website, it could work.