Cameras in Pygame

preview_player
Показать описание
A video about cameras in pygame, we will create 6 different cameras that should cover nearly every use case.

(You also get lots of perks)

Social stuff:

Timestamps:
0:00:00 - Intro
0:01:24 - Project setup
0:05:36 - YSort Camera
0:15:23 - Player center camera
0:26:08 - Box camera
0:36: 59 - Keyboard control
0:41:25 - Mouse control
0:59:11 - Zoom

Project files
Рекомендации по теме
Комментарии
Автор

"Clear Code" is the best YouTube channel to learn Pygame. These videos are really awesome!

MoviestarsEnglish
Автор

Your videos are just insane. I can't imagine how much work you put into them, but please, never stop, they help me so much. You explain things in a really clear and clever way, thank you!

Gabriel-knri
Автор

It's great that there are people with pedagogical grace, but it's really wonderful when they share their knowledge with beginners. Please don't stop what you're doing 💝

anamariabalaban
Автор

Every single one of your videos help me out in this pygame journey and every single time I find it more enjoyable to code.
Thank you, keep it up with the amazing videos.

Qustode
Автор

I hope you enjoy making these videos as much as I enjoy watching them.

ianmccurdy
Автор

wow, I was literally thinking if you were going to ever post a video solely on cameras in pygame, and here you are.... thx dude

namlasyruhdwohc
Автор

Great video! love the zoom part. I used to subsurface the display and scale it to make the zoom, but that limited my zoom to the display size. I like yours aproach better.

cuaitzzz
Автор

This looks insane! Makes me want to start learning python now

Jimsydonk
Автор

Thank you clear code for showing us camera concepts! I learned a lot from your videos.

But some implementations here seems unnecessarily complicated, for example this method

def my_mouse_control(self):
mx, my = pygame.mouse.get_pos()
if mx < self.camera_rect.left: self.offset.x -= 10
if mx > self.camera_rect.right: self.offset.x += 10
if my < self.camera_rect.top: self.offset.y -= 10
if my > self.camera_rect.bottom: self.offset.y += 10

replaces all 30+ lines of code in the mouse_control method, while working much better in my opinion.

Another problem is zoom implementation, while it works, it's completely destroys FPS (from 300 to 30 and lower) making it completely unusable in practice. While this is probably due to pygame's lack of hardware acceleration, moving creation of scaled_surf out of the custom_draw loop and calling it only when mouse wheel is used helps to some degree.

StarFury
Автор

this is perfect. hope you will never stop doing these kinds of contents.

_caracalla_
Автор

Thanks, I've been waiting for camera tutorial

delloff
Автор

Great stuff! I used the box camera and it was easy to implement in my game. Much appreciated :)

yarin
Автор

Many thanks Clear Code for your time. Developer/CyberSec here, python lover.

pa-vlkg
Автор

Best channel for learning pygame! Thanks Clear Code!

hadimohammadi
Автор

The explanation in this video is very simple, so it's very easy to understand, for the problem in the last video I added

master_zoom = * self.zoom_scale
if master_zoom[0] <= 250 and master_zoom [1] <= 250 :
master_zoom[0] = 250
master_zoom[1] = 250
scaled_surf = pygame.transform.scale(self.internal_surf, (master_zoom))

AndeyKoiwai
Автор

Awesome video!! everything is explained so well and is really clean and well done!! Keep it up!!

austinkowalczyk
Автор

one of the best proggraming tutorial channel👍👍👍

sifacrbn
Автор

I think you are underrated but your game are very awesome!

garainfamily
Автор

you really are great at explaining these.

steveradtke
Автор

I love your videos! Please do the sim city one, it would be really nice to see how the graphics are made, and how to manage all the game logic. Thanks!!

Moprationsz