Teaching an Absolute Beginner to Code
Ғылым және технология
Teaching an Absolute Beginner to Code
My friend has no coding experience, so I taught her how to make a video game in just 1 hour using Pygame!
WATCH LIVE ► www.twitch.tv/polymars
→ Main Channel - kzread.info
→ Twitter - PolyMarsYT
→ Instagram - polymarsdev
→ Discord - discord.gg/sGecnxuwxu
--If you liked this video, here are similar ones you might enjoy!---
PolyMars - Learning Python in 2 Days - Pygame Community Jam
kzread.info/dash/bejne/aaiM1aVxic-poZs.html
PolyMars - Learning SDL2 in 48 Hours - GMTK Game Jam 2020
kzread.info/dash/bejne/d3WBqrOfc6rfnco.html
Giedzilla - 1 Year of Learning Game Development In 6 Minutes
kzread.info/dash/bejne/kah5ltKhfNitqaQ.html
Tren Black - How I Learned Game Development in 30 Days
kzread.info/dash/bejne/hWyrzdN-isyTk9o.html
PolyMars - Making a Game With C++ and SDL2
kzread.info/dash/bejne/m3miktGzgJDQqMY.html
PolyMars - Making a Game With Discord's Bot API
kzread.info/dash/bejne/YpqLxrdxeqa6Zrw.html
PolyMars - Best Python Game Wins $1000 - Game Making Challenge
kzread.info/dash/bejne/gneT0qOgetLWeaQ.html
CodyCantEatThis - I Made Pokemon Red & Blue but its 3D
kzread.info/dash/bejne/Yn2Ykq6KmprWedY.html
Dani - Adding a Giant Crab to my Game So Netflix doesn't Sue me
kzread.info/dash/bejne/m4STqMGkYtXaoMo.html
Пікірлер: 424
am I a good teacher?
@Milk-yi9hg
Жыл бұрын
Teach me
@devmarboy4045
Жыл бұрын
hell yes
@theoutdoorpenguin
Жыл бұрын
Well define good
@DiscoLizzard
Жыл бұрын
yeah but you should have taught her c++ (*very* easy)
@abdulrahmanaladi-2
Жыл бұрын
No
When he said "you do enemies.add" and then it cut to it being "enemies.append", I felt that
@PolyMarsLIVE
Жыл бұрын
shhh
@xetanth87
Жыл бұрын
@@PolyMarsLIVE it's weird that there aren't standardized attribute/method names. Coding in different languages makes me always get the size getter wrong. Is it size, count or is it length? Is it capitalized or not? Is it an atttribute or a method? 🤣
@reisaki18
Жыл бұрын
@@xetanth87 .append made sense because add is something like addition (math). That's why python is the easiest programming language.
@arracso.
Жыл бұрын
@@xetanth87 This is so true: size, len, length, .... and there are more out there.
@the_crypter
Жыл бұрын
@@xetanth87 Yea, I remember when I was learning python and JS concurrently, so I would always get confused between len() and .length()
Basically you programming and her saying "wow" whenever she got lost lol. But seriously, it's a very useful demonstration of the full process of coding. I bet many complete newbs watching this will be able to modify the game to f.e. have more frequent enemies, faster movement, maybe a score based on time/amount of frames etc.. Well played!
@lapointe3344
Жыл бұрын
hello, if anyone passing by could expain to me how did he draw multiple enemies on the screen, ik he used a class and a list but i tried doing it myself and i couldnt, thanks for reading
@ZTRCTGuy
Жыл бұрын
Well not all of them. Because this video could be in chinese and i'd still understand about the same amount of it lol. Little hyperbolic, but not much.
@kermitlaranja
Жыл бұрын
@@lapointe3344 he created a list in which all the enemies were, and he used a for loop to draw a sprite for each enemy in the list, and then move them
@lapointe3344
Жыл бұрын
@@kermitlaranja ye i figured it out yesterday , thanks for the answer tho, i understood the concept but just couldnt implement it into my code using pygame.draw.rect function
If this guy is my teacher I'd be unlearning pygame
@greenin5537
Жыл бұрын
Now I feel good about my tutoring skills when helping friends, I thought I was bad at explaining lmao
@mavdotj
Жыл бұрын
i would like to unlearn python
Very different vibe to normal but I enjoyed it quite a bit. With all the really complex tools and libraries around these days it’s easier to forget you can make something reasonably cool with very little in a short amount of time! Inspired me to maybe try a game jam with Pygame rather than Unity.
First PolyMars taught me the alphabet, now he’s teaching me to code, can it get any better?/??//??!!1!1!!11
@ignatikklokov
Жыл бұрын
yes
@RedPlayer_1
Жыл бұрын
Maybe you'll learn numbers
@cuberton
Жыл бұрын
@@RedPlayer_1 thats a bit of a stretch... i mean if polymars can also teach numbers? HE WOULD BE A LIVING GOD!
@rraaiin
Жыл бұрын
teaching quantum dynamics should be pretty easy
@KQJ_Diya007
Жыл бұрын
Ikr
You declared the variables width and height but still proceeded to hard code 640 and 480 everywhere. But it was still a great video.
As a senior in computer science right now, I enjoyed this video. Feels like a very great way to get someone into programming for the first time, got to talk about all the basics in a single video, and even talked about graphics and game programming. Great video!
VSCode is also called a IDE, Integrated Development Environment, commonly known as: "the thing that has cool text on it"
@RenderingUser
Жыл бұрын
i rekon vs code is just an editor except its got a crap ton of extensions that make it have some IDE featues The IDE version of VS code is called VS (Visual Studio)
@rafsandomierz5313
Жыл бұрын
@@RenderingUser Yeah it is IDE though, doesn't have so much exstensions as VS Code and is really hard for beginner to find in, while VS Code has more easier ordered UI for beginner user.
@__lasevix_
Жыл бұрын
@@rafsandomierz5313 VS is also primarily for .NET Devs (C#) while VSC is an open-source modular IDE made for anything. VSC is also known to be a lot lighter than its cousin although it has a reputation as a memory hog.
I might be biased because I learned how to program by making games in flash but I still think Flash+AS3 is the best way to learn how to code since it feels more organic to manage display using the animation editor and mange logic using code. It also has the advantage of not being forced to learn OOP before learning how to use variables and if statements.
@tristanmisja
Жыл бұрын
Too bad flash is dead
This was actually a really cool video! Loved it!
It would be cool to see a little more "back and forth" going on. Like, you teach a little bit, and then ask them to elaborate on what you taught. It helps engage the learner more.
@obsidianflight8065
Жыл бұрын
I personally believe it was intended to be more of a demonstration than a lesson, judging by how it was streamed and then uploaded to youtube
@microdavid7098
Жыл бұрын
I don't like this technique. I like the repeat something until someone gets it. That's the way I feel is best to learn for me personally. You can teach someone something ask a question and soon forgets everything, depending on long term or short term memory of someone
@prateekpanwar646
Жыл бұрын
@@microdavid7098 What I see the problem is that the student never heard of a term like 'variable'. He would be like "I want to learn making cool websites why are they teaching this variable" and won't learn it until he actually uses it in code itself. So showing variable then making him write some code to see it's effects would make it more clear. Then you ask questions and he can use program to answer them which will make memorization even better.
@WilcoVerhoef
Жыл бұрын
I don't like this technique _on its own_. For a beginner it's pretty useful to get a demonstration of roughly what coding is like (or to refresh that memory) before really diving in. Try explaining variables and for loops to your mom and you'll see they quickly get lost when they don't see the bigger picture. Combining these two techniques from the start (both demonstrating the full process & diving into the details) would be slow, that's more suited for the second or third hour. That's my two cents :)
@MrJoosebawkz
Жыл бұрын
@@microdavid7098 She wasn't really the intended student. His audience was
I absolutely love how you gloss over the small typoes you make (Also please use +=)
It hearts me when a cool guy like you types "score = score + 1"
@spidernh
Жыл бұрын
yeah... it also hurts me to use "var += 1" instead of "var++" because python doesn't have ++
@a.c.2659
Жыл бұрын
+= crying
@chonkydog6262
Жыл бұрын
+= polymars mid
@-rate6326
Жыл бұрын
There's no hurt. That's just heart
@DMSBrian24
Жыл бұрын
maybe it's because it's like 1000 times easier to understand for a complete beginner?
This video has taught me more than every pygame tutorial I have watched!
@JohnSmith-ox3gy
Жыл бұрын
That's concerning. What are tutorials doing wrong?
I love how you are totally kid friendly, love you, love you, love you, lob you
polymars: adds a line of code and explains it. his friend: true
0:57 this video was recorded in a completely different world. RIP Google timer.
it physically pains me when he writes [variable] = [variable] + 1
@lais6303
Жыл бұрын
Is there a better way to do it, how else would you?
@spidernh
Жыл бұрын
@@lais6303 [variable]++ in most languages, in python you would need to do [variable] +=1
I like how chill they are
Moving the square with the arrow keys: woooow, oohhh That’s so adorable :)
3:07 The block moves so fast that it has already moved quite a bit before the window even loaded. What framerate did you have? It took around 2 seconds to move 480 pixels with only 0.1 pixels per frame. That's 4800 frames or 2400 frames per second.
@Splish_Splash
Жыл бұрын
Does it just the speed of while loop? if you write there time.sleep(0.1) block will move slower
@Radiol000
Жыл бұрын
@@Splish_Splash pygame has preferred frame limiter called pygame.time.Clock, you can limit the while loop with its .tick(FPS) method to desired FPS.
I loved it when he said “it’s polymarsin’ time” and polymarsed all over the place.
A variable in computer science is basically the same thing it is in science.
2:20 >no coding experience >knows what a while loop is *choose one*
i love your definiton of "an absolute beginner" being someone who has taken a programming course in highschool. absolute bogus.
To be honest this was more helpful than any other pygame tutorial I’ve used
@ValuedValue
Жыл бұрын
true
@Odin.x.
Жыл бұрын
That's extremely concerning. Please link me the videos you've watched.
@0yaSumi6908
Жыл бұрын
I won't ness with you
lets goooo congrats on 8k
This inspired me to make a small game, it's finished now and I want my friends to be able to play it, they don't have python. I tried with pyinstaller to convert it to an executable but it tells me it's missing the pygame module. Are there any good tutorials on how I can do this?
@QuotePilgrim
Жыл бұрын
The documentation in the pyinstaller main page is your best bet, just read through it. If all you need is quick fix, first make sure you have the line "import pygame" somewhere near the top of your code. If it still doesn't work, try passing "--hidden-module pygame" to pyinstaller (so it would look something like "pyinstaller --hidden-import pygame "). This is sort of a hack and if you're correctly importing pygame you shouldn't need to do this, but it should work.
@qqlez
Жыл бұрын
this is a good tutorial: kzread.info/dash/bejne/noisw9SanpOpmco.html
@troshujin
Жыл бұрын
@@QuotePilgrim I found my mistake, had to install pygame and pyinstaller in the environment of my project, not just on my computer.
@QuotePilgrim
Жыл бұрын
@@troshujin oh, that makes sense, didn't even think of that. Since pretty much every Python program I write is for personal use, I haven't really used pyinstaller in years.
Really a nice video, and also gives motivation to code...
well now i know a little python, thanks
You are way to young to be an expert game developer. But you are doing at great job of explaining things to her to help her learn.
@TheMathias95
Жыл бұрын
I mean, he was clearly joking lol.
@d0dge407
Жыл бұрын
wdym too young?? Like dawg I started at 12, tried the first time at 9. The creator of Choo Choo Charles, he started at 13. What are you on about. Poly mars probably started early too.
Starting to code is so much fun!
@Jaykeduzthings
Жыл бұрын
Key word starting to is
You are an amazing teacher dw
bro the pygame gave me a rush of nostalgia
Teaching an Absolute Beginner to Code: Do you know what a while loop is ? - Yes. This video is an absolute lie.
Hm... I've never programmed anything difficult before, but thanks to your video now I want to try making a simple game. Thank you!
The fact she knew what is python from the beginning it's already a lot
Hello PolyMars how exactly do you delete clones?
Pygame is nice, but I'll stick with GameMaker because I want to be able to have different files for each event for each object by default and it has a room editor, so I don't have to guess where everything goes. That would be hell if I tried making anything larger than pong, asteroids, snake or maybe tetris. Even pacman would be annoying to make. Unless there's a room/level/scene editor available.
Ah yes, my favourite city, Fran Sansisco
I actually learnt a lot from this
@itsaaron6423
Жыл бұрын
i didnt . his teaching is like bees buzzing .
Him: I'm an expert game developer Also him: uses python
@lapointe3344
Жыл бұрын
you dont watch his content do you?
@nayankumarbarwa4317
Жыл бұрын
he is actually good though, imagine teaching a person with no coding background in C++
@NostraDavid2
Жыл бұрын
He IS an expert, because he picked the right tool (Python), for the right job (teaching). Hah!
Awesome vid Can you teach my friends too :’) I really liked that video, did you take place on the gmtk jam? Tip: please dont do score = score + 1 just use score += 1
@michaelepica3564
Жыл бұрын
@@voxlinou you mean digestable right? No insult intended, just trying to help you out.
@liam.3d265
Жыл бұрын
@@voxlinou its not "more optimized" its simple syntactical sugar over the long version
@vCavernosa
Жыл бұрын
@@liam.3d265 false
@RenderingUser
Жыл бұрын
:O gmtk jam? idk bout him but i participated i feel like my game kinda sucks tho
@craftlofer9974
Жыл бұрын
you could just use score = score + 1 for beginning but later you should try moving on to score += 1
dude its 5 am, i have school projects left to finish, i already know pygame, but WHY AM I WATCHING THIS NOW
@hellboy19991
Жыл бұрын
because you have lost control of your life, just like meeeeeeee
Rachel is going to take my jerb
It work! thanks :3
PolyMars PolyMars++ Polymars# Only True Programmers get this
when he said its codin time, i felt that
it took me a while before i realized he said san francisco wrong
bro was like me in my first day as a teaching assistant in my uni
0:54 How did Google make that timer for you? Mine didn't show me a timer and it's only 8 days after your video.
@PolyMarsLIVE
Жыл бұрын
It doesn’t work for me anymore either! Pretty weird, maybe they got rid of it
@NaudVanDalen
Жыл бұрын
@@PolyMarsLIVE Yet another feature they deleted.
bro i learned a lot from this video :")
I love how she kept saying "wHoA"
can we get a part 2
so when it comes down to game development there is: two main functions: *initialization* (Start) and *loop* (kinda like Arduino....) the game pixel count goes from the *top left* to the *bottom right* (y is inverted) Collision Detection is basically a check of *if this touches this, do **____* . { which I realized you can make basic ray-casting by simply making a long and thin collision box at the edge of the enemy sprite } use *arrays* for *enemy positions* and to keep *track* of enemies *death/life* scoring system is a simple collision *counter* Hope you have a great day & Safe Travels!
@TheMathias95
Жыл бұрын
Don't use an array to keep track of stuff. Use a map
@TheSensationalMr.Science
Жыл бұрын
@@TheMathias95 so for the ones who don't know what a map is... care to explain? cause that sounds like a multi-dimensional array or a matrix to me.
@lightswitch2622
Жыл бұрын
it would not work as raycasting
@TheSensationalMr.Science
Жыл бұрын
@@lightswitch2622 sorry saw a doc page from godot that used it to define a function where it checks for collision with the ray-collider line. that is what I meant by "it can work for raycasting", didn't realize raycasting was about lights and shadows of 3d forms till now. also youtbe is a jerk so I can't link the site to you... but I can give you a general hint to it [check godot's docs for more info] /tutorials/physics/ray-casting Hope you have a great day & Safe Travels!
The same as me and my friend who want to code C# right in the begin.
She seems very smart.
The fact that collisions were made without the rectangles and collide_rect() triggers me xD
Except for the classes and such, I pretty much did a game *_exactly_* like this on code org in high school around 2020 The game had issues at times though (thanks slow code org), the player was stuck to the bottom of the window and dodged anvils, that was the gameplay It was a great time
I thought movement was much more complicated than this lol
in python you can use Variable += 1 instead of Variable = Variable + 1
0:00 "Fran Sancisco"
Man she said "Lets make a class in python" so mockingly like she knows it looks procedural as fuck but is OOP
I started learning programming with roblox studio which actually worked really well I was able to learn a lot about code within a year and a half of making roblox games except I'm still too goddamn lazy to learn how to use any other game engine
@tristanmisja
Жыл бұрын
So don't use a game engine, learn how to actually code
You should honestly start a tutorial series
very good video
I may be stupid, but why are you avoiding using +=? I mean typing score += 1 is way easier than score = score + 1 yk?
@wotizit
Жыл бұрын
Good point I wanna know
@polarcat0156
Жыл бұрын
he is noob
Loops should be explained thoroughly, but not focused on, if at all possible. event based programming is poggers, and is also easier to teach to beginners since it's roughly "when (This Happens) we (Do this)"
that thumbnail hurt my brain.. it shouldnt, but it did
that is the tip of the iceberg now teach her assembler, then elliptic curve cryptography, then how mov instruction can be turing complete let her realize how deep is rabbit hole
Atleast i know what variables are
You can hear her pretend to care
bro hit💀💀
yes
Watching this after google removed the timer sad times
what is a register
wait why am I actually learning something from this
@user-hq5cj6ue7e
Жыл бұрын
wait what-
5:31 scares me
So is that the mysterious girl that took the praising unity photo? 🧐
Make the next one teaching an old italian lady how to use an ipad.
@m9ddie
Жыл бұрын
bro reminded me of the time i had to teach my sicilian grandma how to use her iphone 💀
Great! Now teach her inverse binary tree
I'm pretty sure it's San Francisco unless Fran Sancisco is actually a thing.
Thumbnail: "What the ef is a variable?" Me: a SCRATCHER: "OH GOSH DARN YOU-" *blows up*
will there be a PolyMars# ?
ah yes my favorite californian city, fran sancisco
I though "what the fuck" was a variable
and then he uses the same collision script as me as well. maybe im not so bad.
She's actually very smart
@mischiefthedegenerateratto7464
Жыл бұрын
What made you think she wasn't
never in my life that i thought i would a white guy teaching an asian
Nooooooo, he taught her classes😭😭😭😭😭
Nice
''What is a variable"" Teaching an Absolute Beginner to Algebra . I'm kidding...
I feel like they should still know what a variable is. You should at some point learn that in math
Coding isn’t so hard, you need to get the basics first. I would reccomend starting with Scratch if you want to play around, if you want to be professional, do Python. Later, you can try other languages
@ikwenmusic
Жыл бұрын
Exactly what I’m doing. I’ve been making games on scratch, learning python right now.
@shadowkyber2510
Жыл бұрын
Gamemaker 8 also good. It even has it's own language but you don't need to use it unless you want to
@itsaaron6423
Жыл бұрын
has any1 made a hangman ,minesweeper, sudoku solver .
@ondrejkhol5988
Жыл бұрын
I would not recommend python as a first language, learn Java or C# first becuase otherwise you will not understand anything in other languages. A person who knows Java will understand python code but not vise versa. Also skip Scratch, it's useless and dumb.
@nayankumarbarwa4317
Жыл бұрын
@@ondrejkhol5988 just learn C/C++ and you will easily shift into any possible high level languages
after watching 51 coding tutorials this week. i finally came to a realization that coding just isn't for me lol
Pls make some coding tutorials
of course it was nerdy o'hare 💀
the title says "wtd is a variable" when you learn that stuff math-wise in 5th grade...
i use the same coding programm