CODE WITH ME | Python Snake Game

preview_player
Показать описание

🤓 about
Thanks for watching! :)

📝 chapters
0:00 intro
0:34 pygame
1:45 data structures
3:02 creating the playground & snake
4:58 code chrysalis
5:58 creating the target
7:12 coding the snake movement
10:27 coding the snake and target interaction
13:11 boundary conditions
15:00 outro

📝 contact

🎵 music

👀 disclaimer
Views and opinions are my own and do not represent or reflect the opinions of my current or past employer(s).
This video is sponsored by Code Chrysalis.

🏷 hashtags & video content
Software engineer, snake game, python snake game, pygame, code with me, coding vlog, coding video, programming, software engineering, developing software, pandas, data structures and algorithms

#codewithme #pythonprogramming #softwareengineer
Рекомендации по теме
Комментарии
Автор

Code CSJackie15 for 15% off Code Chrysalis' immersive coding course in Japan 🤩
p.s. please don't show this code to my boss

CSJackie
Автор

1:34 You clearly haven't seen the spaghetti I'm able to produce in Java. Spaghetti code knows no boundaries; it transcends design patterns and exists in a higher dimension than we can never possibly understand.

themichaelw
Автор

i loved watching you solve the problems and being happy when something works.

pawlkoech
Автор

It's really nice watching you doing some coding just for fun! I enjoyed the way you went through the problems since that is actual coding.

santiagoseijas
Автор

Dude you're the coolest tutor I've got! The way you're explaining makes so much more easier at least for my understanding.♥

akshat
Автор

always nice to do snake in some language. Awesome that you made us watch you doing it. And im Happy that it's same "struggle" on you side as it was on mine, it's always good to do a little thing outside the box of the normal "work" related programming work. Nice video.

perlhacker
Автор

Awesome Video!
Really clever how you coded this Snake Game with another kind of snake! ;)
Thank you so much for featuring us in the video, we look forward to working with you 🤝
Keep up the good work 💪

CodeChrysalis
Автор

In a weird way, Snake is a good starting point to think about common data structures. How do you represent it? A double linked list is the easiest (add new position to head and pop last position at the tail, skip the second step when eating a fruit). But it's not an efficient structure (chasing pointers to find the next element can be slow). An array would be better, but then you'd have to grow (possibly reallocate and copy) and shift (copying everything by one position). A ring buffer would be perfect, but they usually aren't meant to grow. It could be a fun exercise to see how much you can "over engineer" the problem for best performance (which is of course very silly and pointless for a Snake game, but something AAA devs will have to worry about).

TheTrienco
Автор

I was born in 1963, so I was taught nothing whatsoever about computing at school . And only very superficially in Fortran at Uni.
I am lost, watching this video, Jackie! But impressed.

JohnBarratt
Автор

Well done. I find it humbling to realize that I put in all of the errors in my code.

trex
Автор

This is great Thank you :) it really helps to see a professional going through the same process of finding mistakes, debugging etc and sticking at it until they get the project where they want it. It inspires me to keep going/learning when I get stuck on my owm stuff

Andy-ilkf
Автор

This is what I was looking for months! Just a ''code with me'' with simple exercises like a snake game! Please do more since since this helps so much people who wanna start coding but are stuck on the ''tutorial lane'''. What we are missing are projects and 'code with me' is perfect! Are you thinking about making a series of this? (Already Subscribed)

raquelsilver
Автор

Hey Jackie, Going to watch all your content! just finished my course of basic python and hope to get as good as you.
greetz
Ricardo

ricardoschenk
Автор

I don't have idea what you're talking about but I'll watch and listen

adam-xtte
Автор

The thing that got me out of spaghetti code is Uncle Bob's - Clean Code lessons. Also I am a software engineer (well DevSecOps and automation) but I can't wait to spend the evenings coding games in Unity and watching programming videos like this. I'd love to see if someone checks out this code and adds sprites, I'm curious to see them in pygame.

KojiKazama
Автор

Fun evening project, thanks for sharing! I was just looking at your generate_starting_position() function and I think the reason your snake and target were originally appearing offscreen is because you aren't taking Y into account. You're creating a position_range based on screen width (1280), then returning both a random X and Y coordinate that are based on the screen_width pixels. This is causing you get sometimes land outside the height which is only 720 pixels. A quick change to turn position_range into position_range_x and then create position_range_y based on screen_height. Then be sure to use both position_range_x and position_range_y in the return. Not sure if Youtube will format this weird or not, trying anyway:

def
position_range_x = (pixel_width // 2, screen_width - pixel_width // 2, pixel_width)
position_range_y = (pixel_width // 2, screen_height - pixel_width // 2, pixel_width)
return [random.randrange(*position_range_x),

seanwcom
Автор

Hello my best instructor. Congratulations on this incredible tutorial!

KaiagaAg
Автор

Loved learning this and coding along. I also love your random trail of thoughts ♥

pulledporksammiches
Автор

Glad you made it through Amazon video layoffs. Go Jackie! Another relaxing video, thanks!

ChillDev
Автор

I joined uni in London at 34, now doing my 2nd year of Computer Science. I just wish they were focusing more on practicing the actual useful skills and not just writing report, reference, academic style bla bla.
You making some cool videos, giving me some ideas to be more efficient!

Antal
welcome to shbcf.ru