Share your repls and programming experiences

← Back to all posts
pygame: basic platformer!
h
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
OldWizard209
iocoder
JBloves27
Dunce
Squrril
RhinoRunner
TsunamiOrSumth
IntellectualGuy
programmeruser
parkerslv
Comments
hotnewtop
OldWizard209

Again, VERY UNDERRATED

SeamusDonahue

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

OldWizard209

Yep Loved it @SeamusDonahue

iocoder

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

SeamusDonahue

thanks. funny comment btw! @CodingRedpanda

iocoder
DominicHuieWhit

level 3 is my favorite

SeamusDonahue

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

JBloves27

Nice job! Ive never seen a pygame platformer!

SeamusDonahue

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

JBloves27

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

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

JBloves27

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

SeamusDonahue

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

JBloves27

:) thanks! @SeamusDonahue

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

JBloves27

ok. yeah, i use unity ;) @SeamusDonahue

DSAEvan

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

DSAEvan

me love parkour fun! I never really understood pygame

RhinoRunner

Lol I love pygame!

SeamusDonahue

me too! @RhinoRunner

RhinoRunner

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

tussiez

Awesome! I played to the end :)

[deleted]

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

SeamusDonahue

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

AidanWaner

{"(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)"}

SeamusDonahue

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

Whippingdot

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

SeamusDonahue

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

Whippingdot

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

SeamusDonahue

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

Whippingdot

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

ElixirAlpha

uhhhhhhhhhhhh how do u play it

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

DSAEvan

lvl 9 is impossible

SeamusDonahue

is not true @DSAEvan

DSAEvan

@SeamusDonahue Why can't i do it?

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!

SeamusDonahue

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

ColePete

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

SeamusDonahue

glitch with repl.it try reloading @ColePete

ColePete

@SeamusDonahue ok, that worked, Nice game

SeamusDonahue

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

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
IntellectualGuy

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

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

IntellectualGuy

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

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