C++ Developer Learns Python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I'm learning programming for school and honestly, i'm doubting whether I'm good at it or not.. I always need help from others and can never seem to accomplish anything on my own. I never seem to know what to do or what I'm doing or how to solve a problem. I had a school project in python to do for today and I started to do it but got discouraged and just stopped, didn't even bother. Procrastination is really annoying, I had two weeks to do it and I started on the day before last. Interesting game you've made for yourself :) Sorry if that was weird, I just needed to vent. I feel like such a failure.

πŸ‘οΈŽ︎ 6 πŸ‘€οΈŽ︎ u/[deleted] πŸ“…οΈŽ︎ Mar 13 2021 πŸ—«︎ replies

This is Flappuccino, a clicker game I made in 2 days using Pygame! The game isn't much, but I had never used Python before so it was a great opportunity to force myself to get familiar with it. If you want to see how it went, the video attached to this post goes over the entire development/learning process, and you can also check out the (questionable) source files on GitHub: https://github.com/PolyMarsDev/Flappuccino

πŸ‘οΈŽ︎ 5 πŸ‘€οΈŽ︎ u/PocketMars πŸ“…οΈŽ︎ Mar 13 2021 πŸ—«︎ replies

You discount Python as not being as powerful as other software, but it definitely goes hand-in-hand with a lot of games to make back-end tools as well as what most bots on twitter run on. You might want to consider a future as a technical artist!

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/thegospelofsand πŸ“…οΈŽ︎ Mar 13 2021 πŸ—«︎ replies

This post appears to be a direct link to a video.

As a reminder, please note that posting footage of a game in a standalone thread to request feedback or show off your work is against the rules of /r/gamedev. That content would be more appropriate as a comment in the next Screenshot Saturday (or a more fitting weekly thread), where you'll have the opportunity to share 2-way feedback with others.

/r/gamedev puts an emphasis on knowledge sharing. If you want to make a standalone post about your game, make sure it's informative and geared specifically towards other developers.

Please check out the following resources for more information:

Weekly Threads 101: Making Good Use of /r/gamedev

Posting about your projects on /r/gamedev (Guide)

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/AutoModerator πŸ“…οΈŽ︎ Mar 13 2021 πŸ—«︎ replies

Ooh you did all this without python knowledge? Respect!

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/Savvu_The_GameDevel πŸ“…οΈŽ︎ Mar 13 2021 πŸ—«︎ replies
Captions
i have never written a line of code in python before and now that i'm graduating high school i'm going to have to change that if i ever want to get a job so i thought it would be fun to try to learn python in the context of game development using a library called pygame sure python isn't the best language for making a real-time game but it's definitely good enough for my garbage so i found a week-long game jam that was perfect for this the pie game community new year's jam but because i thrive off of self-imposed dress let's just take the week and shorten it down to two days here's how i learned python in 48 hours [Music] so i had exactly 48 hours from saturday at 10 a.m to monday at 10 a.m i woke up early on saturday to set things up which actually ended up being really easy i ran the python installer added the python extension to vs code typed this command and there we go [Music] my first python program it seemed like things were off to a pretty good start but this didn't last long i thought it would be fun to livestream the creation of this game so when my time started i plugged in my low quality webcam i used for online school and hit the go live button okay i just went live i will wait for some people to join and then i'll explain what's going on i didn't really anticipate how this would impact my workflow the first 25 minutes or so of the stream was just me fumbling around my stream lab settings and stuttering while trying to read chat i tried to explain my game idea using some breathtaking drawings the jam i was participating in had the mandatory theme adventures which is pretty broad and didn't really spark any interesting ideas but there were also five bonus themes one of them being coffee i like the idea of caffeine raising your stats because let's be honest it's pretty realistic so i came up with the general concept of flapping because i haven't made enough flappy bird clones and you can collect coffee to make your flap stronger with the goal of flying as high as possible i kept a very small initial scope which was probably for the best someone posted in the chat how to declare a variable as i got more used to streaming i started making actual progress i found a pie game example that showed me the general process of drawing graphics to the screen so referencing that i made this square then with some math i made the square fall every frame i add a fixed value to a y velocity variable then i add that variable to a y position variable and i draw the square at that y position the logic was pretty simple but i still had no understanding of python syntax i was able to get through by just giving it my best guess oh and then waiting for 20 people in the chat to tell me what i did wrong i figured out how keyboard input worked in pi game and made it so when you press a key the velocity variable is set to a negative fixed amount so now my blue square can flap i gave the player an x velocity that flips if its x position is less than 0 or greater than the screen width and now the core mechanic of the game is done the fact that this took an entire hour was pretty depressing so i switched my focus to working on art for the player i started making a coffee mug and ended up with this weird bird mug hybrid apparently coffee is extremely toxic to birds and can lead to cardiac arrest so in hindsight that probably wasn't the best decision i added the sprite to the game using pygame's blit function and then started working on a sprite for the collectible i thought of making them like coffee droplets or something but then someone in the chat suggested coffee beans which made a lot more sense i just kind of threw it in the game and left it there for now i flipped the player sprite based on its direction and then rotated it based on its y velocity to give it a simple flapping animation well it should have been simple combining flipping and rotating led to a lot of weird issues oh gosh okay now was time to make this bean on the screen actually do something with how much i learned over the course of the stream so far the syntax barrier was pretty much gone now and i was able to do things a lot more quickly i started by creating a camera that follows the player basically i just offset everything on the screen by the player's y position to further give the illusion of height i made a placeholder scrolling background to do this i just set the background texture's position to the nearest multiple of the screen height and so you don't notice it teleporting i also draw background textures at the multiples above and below that to act as a buffer then i made a beam class with the vector 2 to store its position and wrote a function for rectangle collisions i created a list of 5 bean objects set their position to a random range above the player and draw a bean sprite to the position of every bean in that list then for every bean object in that list i check if it collides with the player and if it does reset its position to a random range above the player and with that i finally had a basic gameplay loop but the trade-off was my sanity streaming for seven hours straight probably isn't healthy so i wanted to give a quick shout out to flexispot for sending me one of their height adjustable desks and office chairs they are super comfortable and neither of them took more than an hour to build which i thought was really cool links to both of them will be in the description even though i was pretty exhausted after this stream i started working on some kind of ui i created a score counter based on the player's y value and pi game lets you create a texture from text so using a rounding system like the one for the scrolling background i displayed it on the walls behind you as if you were moving up floors the next morning i made things look a bit nicer and also decided to keep track of the amount of coffee beans you collect then i made a caffeine meter by just scaling a rectangle it's constantly decreasing and refills once you collect a bean then about 24 hours into the jam i hesitantly started another live stream luckily things started off a lot better i made a trello board and planned everything i had left to do first off was the upgrade system when i came up with the game concept i wasn't too sure of how complex i wanted this to be but by this point i had a pretty concrete idea press button so i started off by making a simple button sprite in then back in vs code i made a button class then a list of button objects i draw each button to the screen with their x value based on their index in the list and to pick the y value i just guessed i'll do like 400 380 all right 390. then i added title level and price values to the button object and drew those to the screen as well but i realized cramming all of that text into a tiny button wasn't really going to work so instead of using text for the upgrade type i decided to use graphical indicators instead i made the bass icon in then icons for a jump up power up and a speed up power up and draw them at the top left of each button i already had a collision function so i could just plug in the mouse coordinates and dimensions with those of each button okay zero one okay so now when you click the button it tells you the index then if you click and have more coffee beans than the price i subtract the price from your bean count increase the level and price of the upgrade and then based on the type of upgrade multiply your x velocity or flat force by 1.5 and now we have an exploitative and addictive game mechanic after that i decided to add one more upgrade it took a bit of balancing but it's a power up that adds to the amount of coffee beans that spawn i realized it was probably time to get rid of my placeholder background so i made these snowy hills or something and i shifted to you based on the player's y position it sounds simple and it probably should have been simple but this ends up taking two hours but you know i can just write my video script in a way that makes it seem like it didn't take any effort at all hey what that that makes no sense it's not wait stop don't show that there after that questionable end to the stream i made some tweaks to the ui and got to work on some sound effects the 48 hour deadline was getting pretty close so i may have just generated some ear piercing garbage with sfxr then i added the ability to restart the game once your caffeine meter reaches zero finally i made a splash screen in title screen the game's name is a really funny pun package my project to an executable and the next morning i made an itch page for the game and submitted it to the jam i also put the source on github i might be terrible at coding but at least i'm transparent about it links to both of those will be in the description if you want to check them out so yeah that's everything the game isn't much more than a scuffed hybrid of flappy bird and cookie clicker but i can write code in python now a lot better than i could 48 hours ago someone posted in the chat how to declare a variable so i would definitely consider this a win also if you didn't notice i have a twitch now streaming this challenge was a lot of fun and i definitely want to do it more often so make sure to check it out if you're interested in watching my streams that's all so thanks so much for watching and i'll see you in the next video you
Info
Channel: PolyMars
Views: 904,600
Rating: undefined out of 5
Keywords: polymars, flappuccino, pygame, pygame jam, pygame community, python, gmtk, game jam, making of, itch.io, behind the scenes, gmtk jam, pygame community new years jam, gmtk game jam, game dev, indie dev, 48 hours, tutorial, cookie clicker, flappy bird, 2 days, code, devlog, game development, i made a game, in 24 hours, in 48 hours, c++ developer learns python, c++, c++ developer, sdl2, sdl2 developer learns python
Id: 7tXsC8YlCq8
Channel Id: undefined
Length: 9min 25sec (565 seconds)
Published: Wed Mar 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.