Skip to content
← Back to Community
pygame: basic platformer!
Profile icon
SeamusDonahue

Pygame platformer

In this game you use a/d to move and space to jump.
the white are walls and ground, and the red is lava
get to the green goal!
there are 11 levels (not counting level12 because it's just a thx)

This was made primarily for the goal of seeing if I could make a platformer using pygame.

level maker

now obviously I did not program the levels by hand.
I used a level maker I made for my game.

if you would like, you can share your levels with me.
this is how to use it:

  • in console type "python level_maker.py"

  • click the screen two times to make a wall (first sets the x,y of the wall, second sets the width,height relative to the x,y), hit l to make lava where the mouse is, and hit g to make a goal (one per level)

  • hit the x button when done and it will ask you in console for what level number to save as, this may be anything above how many levels I have made, if it is not a number, it cannot be loaded by main.py, if it is > 1, same thing, and if you choose below the amount of levels I made, the file will already exist and you level won't save.

  • to test level type "python main.py (level number)"

  • if you like share the json with me and It might be added to the game

if you wish to delete a wall, click on it as your first point, this will not set the first point but delete the clicked wall
to delete lava, same thing but hit l instead of clicking

have fun!

Voters
Profile icon
SumaitaAlam
Profile icon
MadocM
Profile icon
de116
Profile icon
HenryShears
Profile icon
OldWizard209
Profile icon
glitchish
Profile icon
JBloves27
Profile icon
Dunce
Profile icon
Squrril
Profile icon
RhinoRunner
Comments
hotnewtop
Profile icon
glitchish

Lvl 1: Ok
Lvl 2: ...
Lvl 3: Oh no
Lvl 4: iMpOsSiBlE
Lvl 5: Hmmm
Lvl 6: ..
Lvl 7: Ugh.
Lvl 8: Wah
Lvl 9: Yes (almost there)
Lvl 10: YEAAA
Lvl 11:

** * YEAAAAAAAAAAAAAAAAAAAA * **

Anyway, cool game!
@SeamusDonahue

Profile icon
SeamusDonahue

thanks. funny comment btw! @CodingRedpanda

Profile icon
glitchish
Profile icon
OldWizard209

Again, VERY UNDERRATED

Profile icon
SeamusDonahue

thanks! I'm glad you enjoyed my game! @OldWizard209

Profile icon
OldWizard209

Yep Loved it @SeamusDonahue

Profile icon
DominicHuieWhit

level 3 is my favorite

Profile icon
SeamusDonahue

cool, thats when i added lava to the game! @DominicHuieWhit

Profile icon
JBloves27

Nice job! Ive never seen a pygame platformer!

Profile icon
SeamusDonahue

Thanks! I applied knowledge I had from a different game engine to pygame. (the other game engine was gamemaker studio 2) @JBYT27

Profile icon
JBloves27

Np! hmmm, ive never heard of that game engine... sounds fun! :) @SeamusDonahue

Profile icon
SeamusDonahue

Its pretty cool but its expensive and can't do 3d very well, however it uses an easy to learn language (not python its called gml and its just made to be easy syntax similar to c# or java but without type casting or ;'s) @JBYT27

Profile icon
JBloves27

ah, ok! Thanks for telling me about it! :) @SeamusDonahue

Profile icon
SeamusDonahue

however it, like pygame uses positive y to go downwards. so that's one the of the reasons I got used to pygame.

Profile icon
JBloves27

:) thanks! @SeamusDonahue

Profile icon
SeamusDonahue

yea np! im pretty sure it has a free trial version but personally I think if you want an engine use unity because its free and does more. @JBYT27

Profile icon
JBloves27

ok. yeah, i use unity ;) @SeamusDonahue

Profile icon
LincolnMiddle

I get through the hardest parts, but I mess up on the easy ones

Profile icon
LincolnMiddle

me love parkour fun! I never really understood pygame

Profile icon
RhinoRunner

Lol I love pygame!

Profile icon
SeamusDonahue
Profile icon
RhinoRunner

@SeamusDonahue This is better than any game I've ever made (only if it gets >95 upvotes) I like it!

Profile icon
tussiez

Awesome! I played to the end :)

Profile icon
[deleted]

Dude this is sooo awesome, can u teach me pls? I am having difficulty learning pygame in repl

Profile icon
SeamusDonahue

thanks, I learned a lot of what I know from stack overflow, and the pygame docs. @NimaSherpa3

Profile icon
robertoblong

{"(0, 192)": "(32, 16)", "(48, 192)": "(64, 16)", "(32, 192)": "(256, 16)", "(272, 192)": "(16, 16)", "(256, 192)": "(0, 16)", "(112, 192)": "(144, 16)", "l(288, 192)": "(288, 192)", "l(304, 192)": "(304, 192)", "l(320, 192)": "(320, 192)", "l(336, 192)": "(336, 192)", "l(352, 192)": "(352, 192)", "(96, 192)": "(48, 0)", "(128, 128)": "(16, 16)", "(128, 176)": "(16, 16)", "(128, 160)": "(16, 16)", "(128, 144)": "(16, 16)", "(144, 144)": "(16, 16)", "(144, 160)": "(16, 16)", "(144, 176)": "(16, 16)", "(160, 176)": "(16, 16)", "(160, 160)": "(16, 16)", "(96, 176)": "(16, 16)", "(96, 160)": "(16, 16)", "(96, 144)": "(16, 16)", "(96, 128)": "(16, 16)", "(80, 144)": "(16, 16)", "(80, 160)": "(16, 16)", "(64, 176)": "(16, 16)", "(64, 160)": "(16, 16)", "(80, 176)": "(16, 16)", "goal": "(368, 176)", "(368, 192)": "(16, 16)", "l(112, 176)": "(112, 176)", "(0, 176)": "(16, 16)", "(0, 160)": "(16, 16)", "(0, 144)": "(16, 16)", "(0, 128)": "(16, 16)"}

Profile icon
SeamusDonahue

thanks for submitting a level, ill test that right away
@AidanWaner

Profile icon
Whippingdot

this too hard don't stand to close ...THIS IS IMPOSSIBLEE

Profile icon
SeamusDonahue

ive done it and im not even good at mario, its definitely possible, especially because this doesnt slide like mario @Whippingdot

Profile icon
Whippingdot

The thing is a little laggy so I can't do the third stage @SeamusDonahue

Profile icon
SeamusDonahue

the fps seems to stay at 60, i think its the connection to repl.it that does that @Whippingdot

Profile icon
Whippingdot

BUT HOW DID YOU DO THE THIRD STAGE?? @SeamusDonahue

Profile icon
ElixirAlpha

uhhhhhhhhhhhh how do u play it

Profile icon
SeamusDonahue

click on the pygame window to make sure it has keyboard focus then use w and d to move and space to jump @PilotDevKarwa

Profile icon
LincolnMiddle

lvl 9 is impossible

Profile icon
SeamusDonahue

is not true @DSAEvan

Profile icon
LincolnMiddle

@SeamusDonahue Why can't i do it?

Profile icon
Dunce

awesome game! but I tried to access the level editor multiple times, and nothing happened, I had fork the repl, and edit the code so I could get to it, other than that great game!

Profile icon
SeamusDonahue

oof im not sure what the problem you were having was, great to hear you liked my game though! @Dunce

Profile icon
ColePete

it doeasn't load, it just shows this the whole time
image

Profile icon
SeamusDonahue

glitch with repl.it try reloading @ColePete

Profile icon
ColePete

@SeamusDonahue ok, that worked, Nice game

Profile icon
SeamusDonahue

Thanks! feel free to make a level if you would like! @ColePete

Profile icon
Squrril

Hello Seamus. Some suggestions:

  • Add the ability to jump with the "W" key, because A+D and space is a lot harder than standard WASD
  • add a death counter
  • add a timer (speedrunning competitions, anyone?)
  • and finally, add a level identifier so you know which one you are on
Profile icon
IntellectualGuy

This is an awesome game dude, but can you add more lvls?

Profile icon
SeamusDonahue

maybe but its not easy making levels with only three elements, soon I will make this with more elements to work with and more level editor centered (like mario maker) @IntellectualGuy

Profile icon
IntellectualGuy

@SeamusDonahue That would be rlly good ,but even without it this game is sick.

Profile icon
SeamusDonahue

the game does have a level editor btw, it says on the post how to make a level, the new repl would just have more elements and be more suited to making levels @IntellectualGuy