Grimmys / rpg_tactical_fantasy_game

A tactical turn-based game project in pygame, open to support
GNU General Public License v3.0
405 stars 85 forks source link

Allow game to progress through different levels #7

Closed RamboNation closed 4 years ago

RamboNation commented 4 years ago

Keep track of the current_level and increment it after a victory. Load the new map and allow the player to continue playing. Display the current level in the sidebar to keep track. Had to modify the return value of level.update_state() to allow for more than just a binary state of quit or keep playing. Tried instead to use the existing states of G, I and F, then added a state V for victory.

Grimmys commented 4 years ago

Hello,

Thank you very much for your contribution !

I read your code for a bit, and it's seems totally good... I'll try it and merge it in a few days ! ;)

(PS : I don't know if you planned to make other contributions, but I'm trying to undertake a whole refactoring, according to some advice given by reddit's community... I just wanted to warn you.)

RamboNation commented 4 years ago

@Grimmys Hey that's great, I'm glad my changes weren't terrible. I had fun playing the game and then wanted to add a level and went down a whole rabbit hole trying to figure out how to do that. And I figured as long as I had made the changes for myself I should at least share them. A refactor actually does seem like a good idea, there's definitely some areas that could benefit. Feel free to nuke and/or ignore any of my changes if necessary, I'm curious to see how the game evolves.

Grimmys commented 4 years ago

Hello @RamboNation , I just tested your changes a few hours ago, and there is a small display bug : when loading a saved game, level isn't correctly initialized, due to level's instanciation not following the new argument you added (line 270 in StartScreen.py). I could patch it myself or let you fix it before merging, I don't know what is best...

And yeah I know my code is really rough... Even if I chose to make my game open-source, I didn't really think it would attract other contributors at first. I will clean it. ;)

Anyways, thank you for your support, it really helps me !

Grimmys commented 4 years ago

Hello again, after an intensive reflexion, I decided to merge your changes and patch it myself.

I think it would be better since my code is not clear enough and I need to do a a big refactor at the same time.