- Видео 17
- Просмотров 448 348
CDcodes
США
Добавлен 17 июн 2020
Hey there, I'm Christian. I'm a data scientist who likes to code and develop video games during my free time. I'll post some of what I learn on this RUclips channel. You can expect to see tutorials or chats that will hopefully teach you something new!
Hope you stick around : )
Hope you stick around : )
Thank You Pygame
An ode to pygame, the quirky little python module that tricked me into learning Python.
Any future content on this channel will likely not be pygame focused. That being said, I super appreciate anyone who watched those videos! I hope you learned something useful along the way : )
Learn more about pygame here:
www.pygame.org/news
github.com/pygame
Checkout my personal channel if you'd like:
www.youtube.com/@sunset_cd
Any future content on this channel will likely not be pygame focused. That being said, I super appreciate anyone who watched those videos! I hope you learned something useful along the way : )
Learn more about pygame here:
www.pygame.org/news
github.com/pygame
Checkout my personal channel if you'd like:
www.youtube.com/@sunset_cd
Просмотров: 8 621
Видео
Beginner Python Project From Scratch: Web Scraping Switch Game Sales and Review Scores
Просмотров 1,4 тыс.Год назад
In this video, I'll be walking you through a real-world web scraping scenario to gather as much information as we can about the sales and review scores of Nintendo Switch games. We'll be starting from absolute scratch, and build a data set from the ground-up. Links: Personal Channel - www.youtube.com/@sunset_cd Wikipedia Table for Best-Selling Switch Games - en.wikipedia.org/wiki/List_of_best-s...
Beginner Python Project From Scratch: Rock Paper Scissors
Просмотров 3 тыс.2 года назад
Follow along with me on replit: replit.com/new/python3 In this tutorial, we'll be creating this simple 1-player Rock-Paper-Scissors game using python. Despite being simple, there's a lot to learn about Python and coding in this small little project. The video assumes you know a bit about some of the basics of coding (variables, if-statements, and while loops). Everything else is explained in mo...
Beginner Python Project From Scratch: Tic Tac Toe
Просмотров 72 тыс.2 года назад
Follow along with me on replit: replit.com/new/python3 In this tutorial, we'll be creating this simple 2-player tic-tac-toe game using python. This was my first assignment when I took Intro to Programming in University, so I thought it be a fun little game for beginners to tackle. Despite being simple, there's a lot to learn about Python and coding in this small little project. The video assume...
Pygame Saving and Loading Tutorial: Creating Customizable Controls
Просмотров 8 тыс.3 года назад
In this tutorial, we're going to see how we can use Saving and Loading to create customizable controls and profiles to enhance a player's options and experience. Download the font: dl.dafont.com/dl/?f=retro_gaming Github repository for this Tutorial: github.com/ChristianD37/RUclipsTutorials/tree/master/CustomControls Personal Channel - www.youtube.com/@sunset_cd Links to other videos: Game Stat...
Pygame Game States Tutorial: Creating an In-game Menu using States
Просмотров 33 тыс.3 года назад
In this video, we are going to create a flexible game state framework that will allow us to create an in-game menu using Pygame. This is an expansion on some of the ideas from the Menu Tutorial, which is my most popular one. Download the assets folder: drive.google.com/drive/folders/19pJEYsdqwJUA53sQtLGf0BPqgl4ZzrKb?usp=sharing Links to other Videos: Framerate Independence - ruclips.net/video/X...
Pygame Framerate Independence Tutorial: Delta Time Movement
Просмотров 19 тыс.3 года назад
In this video, we'll discuss Framerate Independence. We'll learn how we can implement delta time movement and make our games play consistently across different hardware. This was a topic I briefly touched, but wanted to go into more detail. Code can be found on my github: github.com/ChristianD37/RUclipsTutorials/tree/master/Framerate Independence Personal Channel - www.youtube.com/@sunset_cd Mu...
Pygame Platformer - New Levels and Swimming (Natural Selection Devlog #2)
Просмотров 2,5 тыс.3 года назад
An update on the progress I've made with my 2D Platformer titled "Natural Selection." The game is made using pygame and planned to be released for free when a playable build is ready. All code and assets for Natural Selection can be found on the Github: github.com/ChristianD37/RUclipsTutorials Personal Channel - www.youtube.com/@sunset_cd Like the cover art? Follow junmetry on Instagram: instag...
Pygame Tile Based Game Tutorial: Collisions
Просмотров 15 тыс.4 года назад
In this video, we'll discuss AABB tile collisions. We'll learn how to detect collisions in Pygame and how our player should interact with the collided tiles. Code can be found on my github: github.com/ChristianD37/RUclipsTutorials/tree/master/Tile Collisions Personal Channel - www.youtube.com/@sunset_cd More an AABB collisions: developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_dete...
Pygame Tile Based Game Tutorial: Physics and Delta Time
Просмотров 15 тыс.4 года назад
In this video, we'll discuss player physics and framerate independence. We'll learn how we can create a player character that has fluid and fun movement. Code can be found on my github: github.com/ChristianD37/RUclipsTutorials/tree/master/Physics Personal Channel - www.youtube.com/@sunset_cd Download tiled: www.mapeditor.org/ Previous video in the series: ruclips.net/video/37phHwLtaFg/видео.htm...
Pygame Tile Based Game Tutorial: Tilemaps
Просмотров 56 тыс.4 года назад
In this video, we'll discuss tilemaps. We'll learn how we can create them using Tiled, as well as how we can parse them into pygame. Code can be found on my github: github.com/ChristianD37/RUclipsTutorials/tree/master/Tilemap Download tiled: www.mapeditor.org/ Personal Channel - www.youtube.com/@sunset_cd My video on sprite sheets: ruclips.net/video/ePiMYe7JpJo/видео.html Music: Pokemon Gold/Si...
Pygame Tutorial: Add Playstation 4 Controller Support
Просмотров 13 тыс.4 года назад
In this video, I'll be showing how you can use a Playstation 4 Controller with your game or python program using pygame. The PS4 controller can be hooked up to your PC with either a USB cable or bluetooth. The .json file containing the button keys and the test.py file I used can be downloaded here: github.com/ChristianD37/RUclipsTutorials/tree/master/PS4 Controller Join my discord: discord.gg/q...
Pygame Camera Tutorial: How to Make a Side-Scrolling Camera System
Просмотров 23 тыс.4 года назад
In this tutorial, we'll be creating a camera side-scrolling camera system. We'll learn how scrolling works and how we can make our camera as flexible as possible. All code/images can be found on my github: github.com/ChristianD37/RUclipsTutorials/tree/master/Camera System Questions? Join the discord: discord.gg/qu8a7DfK2X Timestamps: Intro to cameras in side-scrollers: 0:09 Creating the Camera ...
Pygame Animation Tutorial: How to Animate a Player Character
Просмотров 10 тыс.4 года назад
In this video, we're going to be animating my cat Poppy. You'll learn how Animation works and how you can add animation to your game today! All code/images can be found on my github: github.com/ChristianD37/RUclipsTutorials/tree/master/Animation Questions? Join the discord: discord.gg/qu8a7DfK2X Timestamps: What is Animation: 0:19 File Setup (If you wanna follow along): 1:41 Making a simple Pla...
Pygame Sprite Sheet Tutorial: How to Load, Parse, and Use Sprite Sheets
Просмотров 53 тыс.4 года назад
In this tutorial, we'll be learning all about sprite sheets. We'll discuss why we use them, and how you can start implementing them into your games immediately. Code and images for this tutorial can be downloaded at: github.com/ChristianD37/RUclipsTutorials/tree/master/spritesheet Texture Packer: www.codeandweb.com/texturepacker Personal Channel - www.youtube.com/@sunset_cd Pokemon Trainer spri...
Pygame Menu System Tutorial Part 2: Building the Menu and States
Просмотров 36 тыс.4 года назад
Pygame Menu System Tutorial Part 2: Building the Menu and States
Pygame Menu System Tutorial Part 1: Game Loops and Structure
Просмотров 80 тыс.4 года назад
Pygame Menu System Tutorial Part 1: Game Loops and Structure
How do you set up dual shock vibration?
It was a great tutorial, very easy to follow. But one thing i am not able to grasp completely. Why did we call the check_turn function to check who the winner is? I mean the check turn function only returns the number of turn. Or what i am able to understand is, that as soon as the player 1 (let's say) is done with their final winning turn, this function return that and the winner is declared! please help me understand this. thankyou! And once again, great tutorial!
Add load game please ❤
Holy-moly bro's content is making me jolly!
when i tried to main.py file it show me this error ImportError: cannot import name 'Game' from 'game' (C:\Users\abhay\anaconda3\Lib\site-packages\game\__init__.py)
negl this was a sick video, even tho im not gonna use it in my NEA 😭
would this work with the ps5 controller
I got an import error: cannot import name 'Spritesheet' from 'spritesheet', also pygame has no init, QUIT and KEYDOWN, I don't know if you could help me find out why I get those
You sound like a younger @DavesGarage! Also… the moving chimp pygame starter tutorial, how to forget it haha
I rather make my own game engine, not use someone else's, I prefer something that's custom tailored to my needs that I've designed from the ground up & thus have a deep understanding of, plus most game engines are poorly optimized, & doing things yourself is much funner anyway! =)
3:01 was not expecting melee in this video at all.
Maybe you'll catch me at a tournament someday : )
Pygame was my entry to game development, teached me a lot of programming and game design, today I use mostly C and OpenGL but for simpler projects I use LÖVE or pygame.
Love to hear it!
Never really like programming much. I'm "ok" at it, but it's never really interested me all that much.
Thats perfectly fine, definitely not for everyone!
@@CDcodes - I guess I should mention it happens to be the only thing I'm ok at, and I can't make games without it. (Well not entirely true at this point in time).
5:29 Oh hey, there I am!
Appreciate you sticking around and still watching : )
e
Can't believe you only have 3 thousand subscribers. You deserve way more for the quality of your content.
Really appreciate you! Part of that is me needing to upload more content haha. Stay tuned : )
@@CDcodes Haha. No problem at all, do you have any advice on how to make my game organized, I use unity which I'm not sure if you have dove into but I'm looking for some general tips, my games get really messy really quickly and I end up not completing them at all. If you don't really have advice for me because I know, you're more into pygame, that's totally fine.
Something I did in Pygame (that I'm confident you could also do in Unity) is make basic templates for game features that I could recycle. That way if I was away from a project for a bit working on something different, it all followed a similar structure.
I love Pygame! Yes, I love suffering.
As a relatively novice and self-taught Data Scientist who's been considering Pygame as a way to improve my foundational understanding of Python, this is exactly what I needed to hear to keep myself motivated to get through more Pygame courses/tutorials. Great video!
Love to see another fellow data scientist here : ) Best of luck and hope you have fun!
python was always the easiest way to get into something ngl
Game engines are a great way to learn about programming. Back when I was an high school student I really wanted to create videogames so I started using Game Maker, by the time I actually had to learn a programming language at school I already had a good understanding of some of the basic concepts and I was really motivated to learn more. Years later knowing how to code helped me with my PhD and post-doc since I was able to automate a lot of repetitive and time consuming data processing tasks. Also, I think Python is a good choice to start learning.
Awesome to hear that gamedev played a part in helping you achieve something as difficult as a PhD!
0:09 don't worry looking at any python code gives people headaches
I hope to one day write python that doesn't haha
quite nice and inspirational video! Chill voice and vibes makes it pretty good to watch too.
Appreciate you for watching : )
I was able to create a multiplayer 2D "game" in the past two days using pygame and socket. It's just a very basic demo, players can join, move around and shoot eachother. But it felt soooo good to finally understand how all of this works. And I was also able to connect to the server outside of my network using my phone as a hotspot. I was thinkering around with Godot, raylib and ENet before but nothing worked. Now finally pygame or arcade are really easy to understand and run also very smooth.
In the next months I want to build on top of that and create an online 2D top down co-op shooter looter with base build/defense mechanics.
Thats awesome, hope I get to play your game someday!
Oh wow! I Just noticed that I previously saw your videos when me and my friends had to create a game in pygame for a school project. I used your tutorials to get into it at first. The project wasn't big at all but your videos for sure helped me/us :D
Glad to hear my tutorials helped you get started!
eee
It's great to see a new video from you again after so long CD. I also entered the programing era of my life in 2017. Also started with my college going through classes to see what stuck. Then I took a break from coding for a few years to focus on learning improv though on my end. Then I found the gamedev community on youtube and twitch both got me the itch to re-enter programing yet again. I still do it as a hobby for the most part. I also started with Pygame for a couple years made a couple small sized games but never released. But now I've been learning godot and boy glad my basic python knowledge is helping me a bit on this journey since gdscript is somewhat similar structure. Hope things are going well.
Love to hear about your journey! Most of my pygames also remained as essentially bite-sized games that live on my hard drive, but the process has definitely made my transition into Godot much easier haha. Wishing the best on your end, and hopefully I'll get to play your games someday : )
Very well made video. I've lived through a similar software development journey. Fiddling in gamedev with less abstractions kind of unlocked my brain. I remember reading about how RegEx algorithms work leading to learning about Deterministic Finite Automata (Finite State Machine) and having an enlightenment moment after realizing how it could be applied to my old pygame space shooter shooter. Learning about some more concepts like Composition, Dependency Injection, Functional Programming, Errors as values, Traits (FP take on interfaces) etc; combined with my existing DSA knowledge and suddenly my code became way more organized & modular, and it finally feels like I know what I'm doing. Then there's also another type of hard theory such as Graphical Programming (knowing how things actually render), Computer Architecture, Networking (HTTP, TCP, how do your server and client communicate) etc. A lot of such knowledge enlightens the developer enough to cure the imposter syndrome and whatnot, but for some reason none of it is presented in a structured way in textbook form, and none of it is being taught in the mainstream media nor in the education field. Channels like yours are a gold mine for people who aren't lucky enough to stumble upon such obscure but incredibly important information by themselves
Appreciate the kind words and thoughtful comment! It's funny how something like pygame space shooter can just make everything click, but I love to hear it : )
Bless up 🙏
Thank you
Thank you
Thank man
Terrific video on an important topic. Very helpful.
How do I scale
How do I work out what the values should be for my "self.left_border", "self.right_border" and "self.ground_y" variables? Also, in the Github files for this, it references a "self.box" variable, but it doesn't seem to do anything in the code. What is it used for?
I can't find the part where you define "player.ground_y", "player.left_border" or "player.right_border".
Thank you very much, bro! Excellent and clearly understandable example
Happy to help!
yo is that visual code? or smth cuz i see it familiar
It is replit link in the description
My spritesheet renderer doesn't use the JSON metadata, would it work if instead using the list [myspritesheet.parse_sprite("frame_1.png"),myspritesheet.parse_sprite("frame_2.png")... myspritesheet.parse_sprite("frame_n.png")] I were to instead use the list [myspritesheet.getsprite(x, y, w, h), myspritesheet.getsprite(x2, y2, w2, h2)... myspritesheet.getsprite(xn, yn, wn, hn)]
You'd have to modify the function a bit, but it should work
I followed all of the code (up to before the json part), but when I tried with my sprites, it didn't render them, and I can't figure out why.
Amazing
**then velocity change enters the room**
meaning that you need to find the average value of velocity when acceleration is involved. Adding acc*dt to the velocity and vel*dt to the position does not give you the exact position at that point, but the position between that point and next point. And of course this difference can ruin your physics engine giving different output by varying framerate.
Hey I love it ❤ I am also in data science and I am wanting to learn to develop game. Can i know how you learnt the physics behind the game tutorial of pygame was it some books or some video. Pls recommend me some if you can
Thank you! Lots of trial and error honestly. Looking through different tutorials, github repositories and stack overflow. Chatgpt will also be an awesome tool here!
@@CDcodes amazing I admire you! can I connect with you on linkedn?
such an awesome tutorial.
Hi. I have an error saying: TypeError: object.__init__() takes exactly one argument (the instance to initialize)
Hey man I just finished my Cs project this video was a massive help and really boosted my confidence using json files and the concpet of spritesheets. Thank you sm !!!!
Right on, happy it helped : )
how would you create collison rect for a slope
after many videos, this is one of the best for learning sprite sheets as a complete beginner, thank you.
I am having difficulties getting this to work, there are also some files I'm noticing are in the program, but that you haven't said anything about. (spritesheet. py and spritesheet.json)
Deliciously nerdy! Tasty Py!
I have a question. I have like lots of different pictures or tiles that don't have names. What do I do here? in the json file, it doesn't specifically say any names about the tiles. It says something like this: { "columns":18, "image":"..\/..\/..\/..\/Library\/Mobile Documents\/com~apple~CloudDocs\/Pygame Project\/Grounds 1-100\/Block-Land-16x16\/World-Tiles.png", "imageheight":1392, "imagewidth":288, "margin":0, "name":"Mario Tileset", "spacing":0, "tilecount":1566, "tiledversion":"1.10.2", "tileheight":16, "tilewidth":16, "type":"tileset", "version":"1.10" } I just went to the tile set in the tile editor and exported the tile set as a json file. I don't know what to do here. Notice how each tile doesn't have a name. And even if I do have names, should I just cite like 200 of them all? for row in map: x = 0; for tile in row: if tile == '0': self.start_x, self.start_y = x * self.tile_size, y * self.tile_size; elif tile == '1': tiles.append(Tile('Map/World-Tiles.png', x * self.tile_size, y * self.tile_size, self.spritesheet)); elif tile == '2': tiles.append(Tile('Map/World_Tiles.png', x * self.tile_size, y * self.tile_size, self.spritesheet)); I'm confused.
man I have rewatched this video so many times this weekend, you made me change my whole code this video literally took me out of tutorial hell, 100% recommended I never understood inheritance and how to pass a whole game object into another engine object until now... you made me convert all of my noob code into very concise functions... this is one of the best tutorials and channels I've found so far about pygame, thanks! please keep the videos coming you're an amazing teacher!
Love to hear that this video was able to help! Cheers : )
First, I wanted to write code like this to calculate that stuff, but decided to search on youtube. Thanks, man., you did it for me.)