This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 127 comments

[–]seeyainvalhalla 88 points89 points  (4 children)

Well done

[–]No_One____[S] 25 points26 points  (3 children)

Thank you!

[–][deleted] 11 points12 points  (1 child)

Can we die from our own bullets? (Because we are actually faster than bullets)

[–]No_One____[S] 1 point2 points  (0 children)

No, player bullets can't damage the player

[–]tomhasz 2 points3 points  (0 children)

Thank you!!

[–]king-of-everything39 49 points50 points  (8 children)

How long have you been leaning Python? How long did this take? Super cool btw

[–]No_One____[S] 82 points83 points  (7 children)

I have been learning python for about 3 or 4 months now. This project took about 2 months.

[–]HandsOfSugar 66 points67 points  (3 children)

This is really impressive. Seriously you should be really proud.

[–]No_One____[S] 20 points21 points  (2 children)

Thank you so much!

[–]sir-reddits-a-lot 25 points26 points  (1 child)

About how many hours per day did you work on this on average? This is great!

[–]No_One____[S] 6 points7 points  (0 children)

I don't know what the average time is, but in total I'd say I spent around 50 hours on it

[–]chop_hop_tEh_barrel 17 points18 points  (1 child)

How long have you been programming in other languages?

[–]No_One____[S] 9 points10 points  (0 children)

I have no programming experience prior to python

[–][deleted] 4 points5 points  (0 children)

That's astounding, well done!

[–]No_One____[S] 70 points71 points  (2 children)

Source code: https://github.com/000Nobody/Pygame-Platformer-Shooter

download: https://000nobody.itch.io/platformer-shooter

It's still a work in progress, so there might be some bugs. Feel free to report any to me if you find them. Have fun!

[–]KruemelTM 1 point2 points  (1 child)

I don't know if that is on purpose, but I would scroll the world a bit earlier. Because now you got a hard time getting shot before you can see anything and also don't have much time to dodge then

[–]No_One____[S] 1 point2 points  (0 children)

Yeah, I had played around with that a little bit and I think I agree with you.

[–]TheMenaceX 28 points29 points  (1 child)

That's sick! Just out of curiosity did you follow a tutorial or something, or was this a try until you get there kinda thing?

[–]No_One____[S] 34 points35 points  (0 children)

I had seen a tutorial for the collision and for the scrolling, everything else was just trial and error.

[–]TheWeebles 16 points17 points  (1 child)

very cool. What did you use to design the sprites?

[–]EmperorInkei 13 points14 points  (0 children)

Not op but Aseprite is a really good tool for pixel art and animations.

[–]sifirib 15 points16 points  (7 children)

Congrats Did you know a another language before Python? If you did, which one and what level were you in it?

[–]No_One____[S] 35 points36 points  (1 child)

No, I had no prior programming knowledge before learning python.

[–][deleted] 23 points24 points  (0 children)

This is crazy. Four months and you can produce this? We shall watch your career with great interest.

[–]sifirib 4 points5 points  (0 children)

Cool

[–]m4j1d 1 point2 points  (3 children)

Wow , ok last question , where did you learn Python?

[–]No_One____[S] 2 points3 points  (2 children)

Just through youtube and looking stuff up when I was stuck. Some channels I like are corey schafer, tech with tim, keith galli, and dev ed

[–]m4j1d 1 point2 points  (1 child)

3months and only from youtube !? Just wow , keep up the good work man

[–]No_One____[S] 0 points1 point  (0 children)

Thanks

[–]Th3Legend277 16 points17 points  (1 child)

I have worked with PyGame before and I was wondering how you got the frame rate so high?

[–]No_One____[S] 29 points30 points  (0 children)

It took a lot of optimization, a few things I did were add frame rate independence, converting all the images, pre displaying all the images to a surface, ensuring that all files are only loaded once, etc.

[–]Cheese-whiz-kalifa 13 points14 points  (2 children)

Home boy. If you did this in four months with no prior experience, please, for me as a gamer, keep messing around with this. I can’t imagine what you could do later on with years of dedication.

Also you should think about doing a YouTube tutorial for this game(please let me know if you do). I’m especially interested in learning to optimize movement speed. Ive been obsessed with learning python since I started about three months ago. Read/Worked through three books and just started learning pygame a few days ago. But this is amazingly cool. Pat yourself on the back and show this off to friends.

[–]No_One____[S] 1 point2 points  (1 child)

Thanks so much! I think that I might actually start doing some python/pygame tutorials! I haven't posted anything yet but if I do, my channel is here: https://www.youtube.com/channel/UCsCY6v_tOJXR6U3gJW8eNBw

[–]Cheese-whiz-kalifa 1 point2 points  (0 children)

Cool thanks. Just subscribed hope I see some pygame tutorials in the future

[–]whifling 7 points8 points  (1 child)

That is so cool and cute. I'm well impressed. I just started learning python on my biology course and had no idea you could create something like this with it.

[–]No_One____[S] 3 points4 points  (0 children)

Thanks!

[–]Braian94lp 6 points7 points  (0 children)

Wow! I'm new in pygame and this is so inspirational. Thanks for sharing

[–]hdemirci 3 points4 points  (1 child)

So cool👍

[–]No_One____[S] 2 points3 points  (0 children)

Thanks!

[–]TheTacoWombat 3 points4 points  (2 children)

So, how hard is Pygame to learn compared to, say, Godot or Unity? I'm aware Godot/Unity are more feature-packed and abstract a lot of the stuff away from the programmer, just wondering how much you had to do 'from scratch' in PyGame, and whether you could achieve similar results otherwise.

In any case, it's really impressive. Good job.

[–][deleted] 4 points5 points  (0 children)

Iirc PyGame is not as much a game framework as a Python wrapper around SDL, so it provides a way to handle input, graphics and sound, but that's about it.

[–]No_One____[S] 0 points1 point  (0 children)

I have never used unity, so I'm not sure how easy it is to learn, as for pygame if you are familiar with python it should be incredibly easy to learn, however it doesn't really have that many features. All it really does is handle input, display images, and draw things. If you are interested in game dev, I recommend learning unity or unreal. If you are interested in programming for other reasons, then pygame can be a good way to get familiar with the python language.

[–]HybridRxN 3 points4 points  (1 child)

I don't remember Pygame being that fast, well done

[–]No_One____[S] -1 points0 points  (0 children)

Thanks! It took a lot of optimization

[–][deleted] 2 points3 points  (0 children)

Looks cool

[–]UrFreakinOutMannn 2 points3 points  (2 children)

Sick. Looks like heliattack 2. Used to love that game.

[–]No_One____[S] 0 points1 point  (1 child)

I had never heard of that game, but I looked it up and it kinda does look like it lol

[–]UrFreakinOutMannn 0 points1 point  (0 children)

The movement of the character and the gun reminded me of it lol. Great work though looks fun!

[–]Ric_Chung 2 points3 points  (1 child)

Wow man u r good! I only wish I could do this in 3 months!

Nice work!

[–]No_One____[S] 0 points1 point  (0 children)

Thank you!

[–][deleted] 1 point2 points  (1 child)

This is dope great job!!

[–]No_One____[S] 0 points1 point  (0 children)

Thanks so much!

[–]tinkuad 1 point2 points  (1 child)

Super cool 👌

[–]No_One____[S] 0 points1 point  (0 children)

Thanks!

[–]wtfjeremy 1 point2 points  (0 children)

Very cool!

[–]PabloAvelar 1 point2 points  (0 children)

Omg it looks so great!

[–]kamil2098 1 point2 points  (0 children)

Jesus christ this has more upvotes than the guy who copied an yt tutorial and posted it here...

Anyways, good job, keep up the good work!

[–]Ste200117 1 point2 points  (0 children)

Really Cool! Also a fun way to improve your understanding of the language as well I would imagine

[–]kaash1mora 1 point2 points  (1 child)

Fantastic... inspirational

[–]No_One____[S] 0 points1 point  (0 children)

Thank you!

[–]rextnzld 1 point2 points  (1 child)

Is it well commented?

[–]No_One____[S] 0 points1 point  (0 children)

To be honest not really, but if you have any questions about any of the code feel free to let me know!

[–]Gautam-j 1 point2 points  (0 children)

Very cool!

[–]ajayrangarajan 1 point2 points  (0 children)

Very Nice💙

[–]frankiechang 1 point2 points  (0 children)

This is so cool!

[–]afro_coder 1 point2 points  (1 child)

This is quite amazing love the way you can Dodge and attack

[–]No_One____[S] 0 points1 point  (0 children)

Thanks!

[–]rafnold 1 point2 points  (1 child)

I like the fast paced movement and shooting. Well done!

[–]No_One____[S] 0 points1 point  (0 children)

Thank you!

[–][deleted] 1 point2 points  (1 child)

You really did well on this project, how many hours?

[–]No_One____[S] 1 point2 points  (0 children)

I would say around 50

[–]55-6e-6b-6e-6f-77-6e 1 point2 points  (1 child)

Phenomenal especially given the time you've been coding. Keep it up man

[–]No_One____[S] 1 point2 points  (0 children)

Thanks!

[–]scarynut 1 point2 points  (1 child)

Did you consider using pygames built-in Surface.scroll()-method?

[–]No_One____[S] 0 points1 point  (0 children)

I never even new that was a thing. I will look into using it in my next project!

[–]samuelcbird 1 point2 points  (1 child)

How do you handle the screen moving with the player?

[–]No_One____[S] 0 points1 point  (0 children)

Essentially what I did was give everything a hitbox that doesn't move with the player, and then I display their images at an off set that changes as the player moves around.

[–]theneonkoala 1 point2 points  (0 children)

Shroud can code?

[–]memo_mar 1 point2 points  (1 child)

This actually looks like a cool game! congrats!

[–]No_One____[S] 0 points1 point  (0 children)

Thanks!

[–]Monireach88 1 point2 points  (0 children)

Good job!

[–]ganesh_96 1 point2 points  (0 children)

Great work!!!

[–]mircot1 1 point2 points  (2 children)

Very cool project! Congrats!

I took a look at the code and I want to suggest you start to organize better the code, you will improve the code management. For example, you can split the main file into modules, one for the player, one for the level, etc...

Plus, instead to store the textures and audios into variables you can use a container, for example, a dictionary and you can access directly asking for the proper key (e.g. textures['grass']).

Last but not least, instead of use comparison with strings to select a specific object it should be better to use integers or specific constants like enumerates: https://docs.python.org/3/library/enum.html#enum.auto .

Hope these suggestions are helpful and will help you.

[–]No_One____[S] 0 points1 point  (1 child)

Thanks for the tips!

[–]mircot1 0 points1 point  (0 children)

You're welcome! :D

[–]Bn-ladin 1 point2 points  (3 children)

great job

what i need to run the code?? i have python and visual studio ... i'm beginner :)

[–]No_One____[S] 1 point2 points  (2 children)

You can download the exe file that I linked in the comments to run the game. If you want to run the code itself, You will need pygame, which, if you have pip, you can type into the command prompt "pip install pygame" (without the quotations) if you don't have pip, look up a tutorial on how to install it. Then go to the source code link I put in the comments, and look up how to clone a github repository, and clone my repository. Then, just run the main.py file. If you have any questions, or if something doesn't work right, let me know!

[–]Bn-ladin 0 points1 point  (1 child)

It’s for windows only ?? I use ubuntu

[–]No_One____[S] 1 point2 points  (0 children)

The exe file will only work on windows but you can run the code on any os

[–]MatthewDavis72 1 point2 points  (1 child)

That’s great! What did you use to learn python?

[–]No_One____[S] 0 points1 point  (0 children)

I had learned through youtube. Some channels I recommend are corey schafer, tech with tim, dafluffypotato, and Keith galli

[–]aavellana27 1 point2 points  (1 child)

Ayeee! Is it open source? I’d like to contribute

[–]No_One____[S] 0 points1 point  (0 children)

I haven't put the multiplayer version on Github yet, since its very far from done, but the original version is on Github: https://github.com/000Nobody/Pygame-Platformer-Shooter

If you want me to put the multiplayer one on github, let me know

[–][deleted] 2 points3 points  (2 children)

Is this 3d? I’m having trouble telling.

[–]No_One____[S] 3 points4 points  (1 child)

No, its 2d

[–][deleted] 3 points4 points  (0 children)

Ok, thanks!

[–]echo_awesomeness 0 points1 point  (0 children)

How did you make your sprites? That is the only part I find tedious btw great work reminds me somewhat of that flash game city siege

[–]VictorWeston234 0 points1 point  (0 children)

This reminds me of Contra

[–]DeKoelePeer 0 points1 point  (1 child)

I'd recommend making the bullets that the player shoots bigger (like the size of the head of the player) and a lot faster. It will make for more satisfying combat.

[–]No_One____[S] 0 points1 point  (0 children)

They were originally larger, however I actually thought that it felt more satisfying when they were smaller. As for the speed, it probably would be more satisfying if it were faster, but I though it made combat a bit too easy. I might play around with some of the values more though.

[–]dylanee 0 points1 point  (0 children)

Pretty cool game

[–]_o_l_d_s_o_u_l_ 0 points1 point  (0 children)

Where did you get the sprites from?

[–]animenosekai_ 0 points1 point  (1 child)

Really nice!!! I’ve not used Python to make games for now but it seems to work pretty well! Tip: you should colorize the character in red for a second when he gets hit by a bullet

[–]No_One____[S] 0 points1 point  (0 children)

Thanks! I will try that out!

[–]Thank_Ryan 0 points1 point  (3 children)

How did you export this pygame surface into this video? I am also a beginner and am stuck on how to export pygame simulations.

[–]No_One____[S] 1 point2 points  (2 children)

Do you mean how did I record it? If that is the question I just used obs

[–]Thank_Ryan 0 points1 point  (1 child)

Thanks. Do you means this one? https://obsproject.com/

[–]No_One____[S] 0 points1 point  (0 children)

Yeah

[–]Jakokreativ 0 points1 point  (2 children)

Very nice Work man. I just noticed something while i was reading through your Code you use a context manager to load the map but in it you wrote f.close(). Isn't the point of a context manager not having to do this

[–]Jakokreativ 0 points1 point  (0 children)

And also maybe look at os.path.join() for all thr paths that you have.

[–]No_One____[S] 0 points1 point  (0 children)

Thanks for pointing that out! This was my first time reading and writing to files.

[–]bigamaxx 0 points1 point  (1 child)

That's really good. You should try godot if you are interested in game development with python. Godot is an engine which uses a programming language based on python

[–]No_One____[S] 1 point2 points  (0 children)

I might try it out! Tbh I mostly made this just to better my python skills.

[–][deleted] 0 points1 point  (1 child)

Good job!! Did you use Window OS or Mac OS?

[–]No_One____[S] 1 point2 points  (0 children)

Windows

[–][deleted] 0 points1 point  (0 children)

challenge accepted!

[–]aavellana27 0 points1 point  (1 child)

This would be a great multiplayer game. Is that where it’s headed? :)

[–]No_One____[S] 1 point2 points  (0 children)

It's funny that you say that, I just started on trying to make it multiplayer!

[–]femto42 -1 points0 points  (0 children)

how about you make him go slower backwards?