Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 3.53 KB

week-3-4.md

File metadata and controls

50 lines (36 loc) · 3.53 KB

Week 3-4 (19 June - 2 July) Tower Of Hanoi

Progress

Graphical Changes

  • Added filler background to the game to fill up all the blank space.
  • Added the following sprites to the game:
    • Background (updated to work with filler background)
    • Back Button
    • Pause Button
    • Help Scroll

Gameplay Developments

I added move counter to be displayed in the levels. This helps the user keep track of how many disk move operations they have performed.

During these two weeks, I created the game states for Help Menu, Level Select Menu and Pause Menu.

For help menu, I created a scroll sprite that could be used as a background and then implemented a utility function that could render multiple lines of text on a given surface. This is not provided by pygame and I figured that this will be used in other games as well. The function doesn't return a new surface but blits the text on provided surface. The multiple line renderer function also leaves off a right-margin provided as a parameter in the call.

image

For Level Select Menu, I created a new game state that consists of buttons for all levels. These buttons have a highlight-on-hover effect attached to them. And the user can play any level right off the bat. The level number denotes how many disks would need to be moved from source rod to destination nodes. I also added back button to help menu and level select menu.

image

The pause menu was created to ease the user if they want to restart the current level or go back to home screen.

image

Moreover, I added a fade-in and fade-out effect to clouds using interpolation so that they can work correctly with filler backgrounds. It gives a really nice feel to the game and moves it away from being static.

Over these two weeks, I also fixed various bugs and issues that were faced during testing. Some of the issues that were faced and fixed were -

  1. When main.py is executed directly, pygame window size comes out larger than monitor screen size.
  2. The methods implemented in utils.py were static but the staticmethod decorator wasn't used.
  3. There were 100+ flake8 issues that needed to be fixed.

Commits