![CDcodes](/img/default-banner.jpg)
- 17
- 416 576
CDcodes
United States
Приєднався 17 чер 2020
Hey there, I'm Christian. I'm a data scientist who likes to code video games during my free time. I'll post some of what I learn on this UA-cam channel. You can expect to see tutorials that will hopefully be relevant and/or teach you something new. I might also talk about my other nerdy interests from time to time as well.
Hope you stick around : )
Hope you stick around : )
Beginner Python Project From Scratch: Web Scraping Switch Game Sales and Review Scores
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/@ur_homedawg
Wikipedia Table for Best-Selling Switch Games - en.wikipedia.org/wiki/List_of_best-selling_Nintendo_Switch_video_games
Full Code Repository - github.com/ChristianD37/UA-camTutorials/tree/master/Switch%20Sales%20and%20Reviews%20Scrape
Jupyter Notebook Beginner's Guide: www.dataquest.io/blog/jupyter-notebook-tutorial/
Timestamps:
Introduction: 0:00
Setup and Package Installation: 0:45
Scraping Wikipedia for the Best-Selling Switch Games: 3:00
Cleaning the Best Selling Games Table: 9:17
Scraping Metacritic Review Scores: 19:12
Creating the Metacritic Scraper (Obtaining Reviews for all Games): 31:35
Creating the Metacritic Scraper (Obtaining Reviews for all Games): 39:28
Joining the Sales and Reviews Tables: 40:51
Validation and Exporting the Table: 41:57
Final Result and Outro: 44:35
This video does not aim to be a super rigorous scraping/statistcal exercise, but rather present a learning opportunity for someone to view the process of how they can gather their own data in a real-world context.
Disclaimer: Web scrape responsibly. I am not responsible for any repercussions you may experience. Please be nice to any websites when scraping them. Provide a generous delay when scraping and consider avoiding sites that explicitly don't want to be scraped. Using a VPN is also highly recommended. I take no responsibility if you get IP banned.
Links:
Personal Channel - www.youtube.com/@ur_homedawg
Wikipedia Table for Best-Selling Switch Games - en.wikipedia.org/wiki/List_of_best-selling_Nintendo_Switch_video_games
Full Code Repository - github.com/ChristianD37/UA-camTutorials/tree/master/Switch%20Sales%20and%20Reviews%20Scrape
Jupyter Notebook Beginner's Guide: www.dataquest.io/blog/jupyter-notebook-tutorial/
Timestamps:
Introduction: 0:00
Setup and Package Installation: 0:45
Scraping Wikipedia for the Best-Selling Switch Games: 3:00
Cleaning the Best Selling Games Table: 9:17
Scraping Metacritic Review Scores: 19:12
Creating the Metacritic Scraper (Obtaining Reviews for all Games): 31:35
Creating the Metacritic Scraper (Obtaining Reviews for all Games): 39:28
Joining the Sales and Reviews Tables: 40:51
Validation and Exporting the Table: 41:57
Final Result and Outro: 44:35
This video does not aim to be a super rigorous scraping/statistcal exercise, but rather present a learning opportunity for someone to view the process of how they can gather their own data in a real-world context.
Disclaimer: Web scrape responsibly. I am not responsible for any repercussions you may experience. Please be nice to any websites when scraping them. Provide a generous delay when scraping and consider avoiding sites that explicitly don't want to be scraped. Using a VPN is also highly recommended. I take no responsibility if you get IP banned.
Переглядів: 1 163
Відео
Beginner Python Project From Scratch: Rock Paper Scissors
Переглядів 2,5 тис.Рік тому
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
Переглядів 63 тис.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/UA-camTutorials/tree/master/CustomControls Personal Channel - www.youtube.com/@ur_homedawg Links to other videos: Game Sta...
Pygame Game States Tutorial: Creating an In-game Menu using States
Переглядів 30 тис.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 - ua-cam.com/video/Xu...
Pygame Framerate Independence Tutorial: Delta Time Movement
Переглядів 18 тис.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/UA-camTutorials/tree/master/Framerate Independence Personal Channel - www.youtube.com/@ur_homedawg M...
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/UA-camTutorials Personal Channel - www.youtube.com/@ur_homedawg Like the cover art? Follow junmetry on Instagram: insta...
Pygame Tile Based Game Tutorial: Collisions
Переглядів 14 тис.3 роки тому
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/UA-camTutorials/tree/master/Tile Collisions Personal Channel - www.youtube.com/@ur_homedawg More an AABB collisions: developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_det...
Pygame Tile Based Game Tutorial: Physics and Delta Time
Переглядів 14 тис.3 роки тому
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/UA-camTutorials/tree/master/Physics Personal Channel - www.youtube.com/@ur_homedawg Download tiled: www.mapeditor.org/ Previous video in the series: ua-cam.com/video/37phHwLtaFg/v-deo.htm...
Pygame Tile Based Game Tutorial: Tilemaps
Переглядів 52 тис.3 роки тому
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/UA-camTutorials/tree/master/Tilemap Download tiled: www.mapeditor.org/ Personal Channel - www.youtube.com/@ur_homedawg My video on sprite sheets: ua-cam.com/video/ePiMYe7JpJo/v-deo.html Music: Pokemon Gold/Si...
Pygame Tutorial: Add Playstation 4 Controller Support
Переглядів 12 тис.3 роки тому
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/UA-camTutorials/tree/master/PS4 Controller Join my discord: discord.gg/qu...
Pygame Camera Tutorial: How to Make a Side-Scrolling Camera System
Переглядів 22 тис.3 роки тому
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/UA-camTutorials/tree/master/Camera System Questions? Join the discord: discord.gg/qu8a7DfK2X Timestamps: Intro to cameras in side-scrollers: 0:09 Creating the Camera C...
Pygame Animation Tutorial: How to Animate a Player Character
Переглядів 10 тис.3 роки тому
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/UA-camTutorials/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 Play...
Pygame Sprite Sheet Tutorial: How to Load, Parse, and Use Sprite Sheets
Переглядів 51 тис.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/UA-camTutorials/tree/master/spritesheet Texture Packer: www.codeandweb.com/texturepacker Personal Channel - www.youtube.com/@ur_homedawg Pokemon Trainer spr...
Pygame Menu System Tutorial Part 2: Building the Menu and States
Переглядів 35 тис.4 роки тому
Pygame Menu System Tutorial Part 2: Building the Menu and States
Pygame Menu System Tutorial Part 1: Game Loops and Structure
Переглядів 78 тис.4 роки тому
Pygame Menu System Tutorial Part 1: Game Loops and Structure
Just learn pixel art properly or pay an artist. The style will never match your project and it just looks flat-out bad. Your original pixel art looks fine but the AI crap should be left out at all costs.
Thank you
Idk man heard that other artists are offended by this
Thank you
Thank man
Terrific video on an important topic. Very helpful.
Is it possible to have it create the same portrait with different expressions? The trouble with AI tools for me is that it’s impossible to get them to replicate a result with only the change you wish for.
To my knowledge it's not directly possible with this tool (yet). I've seen some other AI pixel art tools but haven't tried them myself
@@CDcodesthanks for letting me know! It looks solid enough for what it does so I may have to try it out!
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)
How can you call yourself an artist if you're using AI? You're a thief, you don't deserve to call yourself an artist. The pixel art that you made is good. You could learn how to make the portrait yourself instead of resorting to the theft of other people's efforts. I hope you understand that you are a disgrace upon artistry.
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.
Thanks a lot man that was incredibly helpful
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.)
really helpful tutorial!
Hey friend, how do I create usable items, like potions, in PyGame?
I guess I'm a little late but this is still informative. Thank! Also, if you havn't used it, enumerate() makes those 'for' loops much prettier.
this json method feels very unnecessary, it's a good tutorial but for a poor implementation that requires a paid program to be efficient... 90% of spritesheets are consistent grids that shouldn't require a json like this
thank you for an amazing video. However im a little confused about line 19 in main file. How does that check if there is an X or O. The last part isnt even a dictionary. Id appreciate a response thanks :)
We start by equaling the previous turn to the current turn (Line 19). Because there's an infinite number of things the player can enter other than a correct board position, the idea is that we assume whatever they give us is invalid input. If they provide invalid input, we don't change the turn. If they actually give us an valid board position, then we increment the turn counter. When the next iteration of the loop occurs, it will check to see if the turn counter when up or not by comparing it to the previous turn. If it didn't, then our assumption that the player would give us something wrong is correct. so we want to print an error message for them.
I am getting the error "pygame: font is not initialised" whenever I run the code, I have copied the tutorial code exactly and got the font required
Which application are you using??
replit, link is in the description
Thata actually pretty cool. Got a sub. Remember me.
"churn" lol
i didnt quite get the file name thing ,
where should put my csv file and layers in the code
its not working, at 2:03 draw_board has a red line underneath it so it isnt working im doing everything the video tells me to
Hi could you do a similiar video, but for moving in any direction and the camera follows you. I think its referred to as "box camera"
Hoenn, Sinnoh and Kalos music >>>>>>> Johto Music
6:00
This is a well put together tutorial video. Thanks for making it!
This is a good tutorial and works well for the tutorial but I'm having trouble transferring it over to a real game. When trying to implement it into my own game with a larger map and where I will need the tiles to scroll/move I don't see exactly how we are suppose to do that with this code. It looks as though all the tiles get drawn once right at the beginning and that's it. Has anyone had a similar problem and solved it? EDIT: I noted around 9:28 you said I would have to store them in a separate list and draw them every frame could you explain this a bit more please?
I don't understand how prev_turn == turn results in an invalid entry. Can someone help me understand?
is it after an if? if it is, it should be if prev_turn == turn: so if theres no if, you only need to put only one "="; prev_turn = turn "==" checks if two values are equal, "=" is (for example) to assign a value to a variable AND OF COURSE, IM STILL LEARNING TOO, i've started coding 2 weeks ago, i could be completely wrong, but thats what i understood ATM
how do you use two controllers, I get how to have a 2nd one detected but that's it.
Awesome info! Thank you so much :)
what if I just took the difference between the set fps and the current fps and then in the next line set the fps where you add the difference to the fps for that loop?
isn't that troubling that rectangles are in completly diffrent places than their surfaces? This approach looks a little odd to me.