What inspired me was the Youtuber "Tech With Tim" and his pygame series. I wanted to do something similar to that, but not a complete copy.

What it does

The character can you the basic movements of left and right and jump. It also has some cool mechanics such as fast fall and a dash.

How we built it

I started by importing all the pictures so we could animate the characters moving. Then I called all the variables I would need to use. If I ever needed to add another variable, I would just add them to the top. I first created the basic movements. Then, I added the cool movement addons such as the dash and the fast fall. Then I created the level with relative ease. I also made a 2nd room where you can access just by running to the right side of the screen. It teleports you into a new room where you can access the things on the room. You can also go back anytime by just going to the left. I made it so the mask was on the 2nd room and you would need to climb a box to grab it. Then you would walk safely past the infected person. Then, you would load into a screen that says "You Win!".

Challenges we ran into

One major challenge was importing the pictures. When I first did it, I knew the judges would have to run it, so I couldn't do the exact path where the pictures with. So, I had to do something relative to the program path. The first method I tried was using OS to merge 2 paths together. I tried it by running "pygame.image.load(os.path.join('images','L1'))". When I did this, I would have a black background. I was extremely confused at first. I thought it was the picture's fault so I tried for multiples in attempt to remove the background. So after many hours of pain and suffering, my teammate(Debdeep Sen), told me that it might be OS's fault and we should try without using OS. So, I found a different way to do it. I ran the code "pygame.image.load('images\L1.png')". And after many hours of work, it worked!

Accomplishments that we're proud of

An accomplish that we are proud of is the hitboxes and detecting collision. This is because none of us ever has done collision before so it was our first time. It was pretty frustrating at first, but we managed to figure it out.

What we learned

What we learned is that if your stuck on something for a long time, and trying one way doesn't work, you should try a different way and it might work. You shouldn't get stuck on something for too long or your just wasting your time.

What's next for Python 2D Platformer

If I was to add more time, I would probably make the hitboxes slightly better and fine tune them more. I would also add more levels to add more sophistication.

Built With

Share this project: