r/Python • u/BlestLeaf • Jan 21 '20
Started learning Python a few months ago...today I finished my first game from scratch using Pygame!
22
u/69shaolin69 Jan 21 '20
May I use your code? I have a great idea. Is it GPL? Or MIT?
Btw looks awesome love it.
edit: It’s mit, thanks I’ll see what I can do with it.
20
7
u/fernly Jan 21 '20
What's the object? I don't see any user input happening?
12
u/BlestLeaf Jan 21 '20
As the blocks approach the buttons on screen, you press the respective arrow key on your keyboard at the same time they intersect to increase your score.
24
u/Mixanus Jan 21 '20
just an idea. you should add an animation to the arrow key blocks just for more visual feedback. visual feedback is very important
4
u/Enfors Jan 21 '20
This is the basis of games like Guitar hero, which you may have heard of. In that case, the blocks are "notes" falling that you "play" by pressing the corresponding button on a plastic guitar.
2
u/janitc Jan 21 '20 edited Jan 21 '20
I recently started as well, can you tell me what recourses are you using to learn?
5
u/BlestLeaf Jan 21 '20
To learn Python itself, I started with the “Introduction to Computer Science and Programming Using Python” MIT course on EdX and after that I used books such as Automating the Boring Stuff to learn more. As for Pygame, just a lot of random YouTube videos :)
2
u/ibalaoffl Jan 21 '20
Ohwww nice work mate!
May be you should help PPL like me by sharing your learning experience of python.
P.s. Assuming you started from the basics.
3
u/BlestLeaf Jan 21 '20
“Introduction to Computer Science and Programming Using Python” on EdX really got me into programming and although it was a pain at first, I kept practicing and eventually nailed down the concepts. I knew I wanted to make a game as my first project so I looked up the Pygame library and tried learning as much as I can from YouTube as well as the documentation.
2
u/ibalaoffl Jan 21 '20
Well.. that's some right direction for newbie... thanks :)
1
u/BlestLeaf Jan 21 '20
No problem! I highly recommend “Automate the Boring Stuff” and “Python Crash Course”! Good luck :)
2
u/ibalaoffl Jan 21 '20
Already gone through automate the boring stuff.. not much of improvement. I guess lack of hands on.. was focussing on finishing the course than working on small coding.
2
2
Jan 21 '20
What's the general ethical rule on using other's code? i'm a beginner too but what is the general consensus on how much we create ourselves and how much we take from others?
I ask because I would like to learn as much as the general python learners.
for example using a soundtrack from someone else is pretty much a given but how about something else?
nice work btw OP
1
u/BlestLeaf Jan 21 '20
I think the general consensus depends on the license. If someone else’s code is under the MIT license, you can use the code in any way you’d like as long as credit is given to the original author somewhere in the source code.
2
u/WorkStudyHardShoe Jan 21 '20
Very nice. I am also learning python and doing basic games like this
How much hours you studied for this and how much hours you were working on that particular project?
2
u/BlestLeaf Jan 21 '20
I’ve been working on it for an average of about a couple hours a day for the past few weeks as there were a ton of minor issues I was trying to solve.
2
u/mr-lh Jan 21 '20
Good job bro 👍🏼 and me i want to learn a programming language but i don’t know which 😕 and which is more easy to learn.
1
27
34
u/knestleknox I hate R Jan 21 '20
Good stuff.
FYI, you should look into creating a requirements.txt file for your github. It'll allow users to install via pip install -r requirements.txt so you don't have to tell anyone to install pygame manually. Also it will version everything exactly.
15
u/piayoung Jan 21 '20
Wow!!! Looks so nice :) I'm learning Python as a beginner and wish I could make like this awesome game in the future
13
Jan 21 '20
I’m shocked that no one has complemented the music. Did you compose it yourself?
7
u/Lyoug Jan 21 '20
From his Github:
Music: "Decades" by Steve Lowther provided by freesoundtrackmusic.com
4
8
u/Dexteroid Jan 21 '20
Bruh i shit you not, I have the idea for this game never really finished it. I am amazed as a beginner you stuck to it and finished it. Good job
6
u/BackwardSpy Jan 21 '20
Looks super cool, great job! If you are interested in taking your project further, might I suggest adding some visual feedback for when you hit or miss a block? Perhaps some particles, perhaps some camera shake... it's up to you how you do it, but it will help a lot with making the game feel really good to play.
5
5
u/Antoinefdu Jan 21 '20
I started learning Python a few months ago, and this made me realise I need to get my shit together.
4
u/LegionOf9 Jan 21 '20
i.. i can’t even get python to say hi to me???
1
u/zack822 Jan 23 '20
x = true
if x == true: print('Sad Panda')
3
2
2
2
2
2
u/kilroy_wh Jan 21 '20
I started also python a few month ago, and I'm always impressed what you can do with it, although I'm using it for data evaluation in science it's nice to see the other aspects of this
2
2
2
Jan 21 '20
[removed] — view removed comment
1
u/BlestLeaf Jan 21 '20
That’s what I was gonna work on next :) In terms of how to learn Pygame, I suggest this video as this tutorial really helped me a lot.
37
u/BlestLeaf Jan 21 '20
GitHub Link: https://github.com/kevinfreyberg/galactiblock