Day 2 - Game Engine, Level Design, SFX and Music, and More Features

Wow, what a day. I got a whole bunch of things done today, and it was really surprising. I feel like the progress I made today made up for the lack of progress I made yesterday, and maybe a little more.

Game Engine

Today I decided to make it so the Player can move in 8 different directions, and they can choose where they want to go by clicking on an adjacent tile that is open for them to go to. I created a system where I can load TMX files and turn them intro a sprite map (more about that later). I also created a system for myself that allows me to link objects to other objects (like a key to a door), which can be pulled from a text file and turned into data values inside sprites which will then do something when the trigger object is interacted with (like when you collect a key it unlocks a door).

SFX and Music

Usually I don't get to this until the last day or two. But today, I created all the Sound Effects for Moving, Clicking, Completing a Level, Dying, Teleporting, as well as Picking up Keys and Gems. I spent around an hour today creating two Game Loops, one for the Menu Screen, and the other for early Gameplay. I got some of my folks to listen to it and they had a better reaction to how it sounded than I thought they would, as I have had minimal experience composing (maybe a couple of times in Band Class a year or two back). I'm interested to see how other people think of it and how well they think it fits with the gameplay and scenario.

Level Design

For creating levels, I decided to learn this new module called PyTMX, which basically just loads TMX format maps into Python for use with Pygame and other modules. I also learned how to use Tiled, which you may have heard of, which is a TMX map editor and TSX tileset creator. This saved me a whole bunch of time, as I remember in my PyWeek 25 and 24 entries I was spending hours transferring a level from paper to computer. Now I can do it in less than ten minutes, which I'm really excited about because it'll give me a lot more time to expand on the game and increase its quality.

I was able to design 3 Tutorial Levels, 5 Easy Levels, and 2 Intermediate Levels, which took me less than 2 hours at most. As the difficulty increases, I decided to gradually introduce new obstacles and objects to the player so they can get used to using it and learning how to use it to their advantage or how to avoid it.

More Features

I added a lot of new in-game obstacles and objects today that can help / harm the player, such as:

  • Hidden Walls that Appear when you cross an imaginary line.
  • Conveyor Belts which allow you to move farther while using less turns.
  • Hidden Traps which you can't see, and when you step on them they instantly kill you.
  • Crumbling Floors (Temporary Name) is basically a floor where when you step off of it, it will crumble away and reveal a trap so you can't walk back on that tile again.

As mentioned in the last section, I created a Tutorial for learning the ropes of the game, and introducing the first, and probably the simplest obstacle in the game. I'm going to get some friends to play it tomorrow to see if there is anything they don't understand or are confused about the Tutorial and I'll fix it after that.

Some other Miniature Features I added:
  • A Restart Level Function
  • A Full screen Mode
  • An Indication that tells you whether the Tile you are hovering over is open and that you can move to it.

Basic UI Design

This PyWeek I tried to speed up my workflow by making it much easier to create Text and Buttons. Earlier I was spending a while trying to correctly position, center, copy, paste, and modify code from different text renders. So I created a whole bunch of easy functions where I can just put in text, specify where I want it, and wether I want it centered, and ta-da, I just saved myself 2 minutes of my time.

More Specifically, I created some menus:
  • Main Menu Screen
  • Pause Screen
  • Settings Screen (temporarily empty)
  • How to Play Screen (temporarily empty)

I still haven't worked much on Graphics yet, as I'm going to wait until I've completed all of the Levels to do that, but for now, here's a screenshot of the Tutorial:
Day 2 Screenshot

I've still got lots to do tomorrow, so I'm going to get to bed.