Thanks for what you do. I'd like to get the feel of the jobs offered out there. Can you go through what is requested in a job that you've done, from the beginning, what you have to interface with, to the end. This may be a good series for your channel. Thanks
At 29:13, I don’t see why you couldn’t swap the values inside the squaring operation. At least mathematically, it wouldn’t change anything. Does this have to do with implementation of math in Python, or was it simply to ensure readability/clarity?
There is an error in this code. If the user doesn't click at all and let its lives go to zero there is a ZeroDivisionError at the end_screen() when we try to calculate the user's accuracy. If someone wants to make the end_screen() more bulletproof try this: def end_screen(win, analytics): win.fill(BG_COLOR) time_label = LABEL_FONT.render(f"Time: {format_time(analytics.elapsed_time)}", 1, "white") speed = round(analytics.targets_pressed/analytics.elapsed_time, 1) speed_label = LABEL_FONT.render(f"Speed: {speed} t/sec", 1, "white") hits_label = LABEL_FONT.render(f"Hits: {analytics.targets_pressed}", 1, "white") # This is the changed part # ------------------------------------------------------------------------------------------------------------------------ # try: accuracy = round(analytics.targets_pressed / analytics.clicks * 100, 1) except ZeroDivisionError as e: accuracy = 0.0 # ------------------------------------------------------------------------------------------------------------------------ # accuracy_label = LABEL_FONT.render(f"Accuracy: {accuracy}%", 1, "white") exit_label = LABEL_FONT.render("Press any key to exit...", 1, "white") win.blit(time_label, (center_label(time_label), 50)) win.blit(speed_label, (center_label(speed_label), 150)) win.blit(hits_label, (center_label(hits_label), 250)) win.blit(accuracy_label, (center_label(accuracy_label), 350)) win.blit(exit_label, (center_label(exit_label), 450)) pygame.display.update() while True: for event in pygame.event.get(): if (event.type == pygame.QUIT or event.type == pygame.KEYDOWN): quit()
Hey Tim, Can you please point me yo the video where you listed all python topics graded as Begineer ,Intermediate etc. I checked the playlist several times but i could not find the List , Your content is awesome. Thanks
Hey Tim! Love the PyGame tutorials. Do you have advice for building web-deployable game applications? Is there a solution that’s optimal for those of us who are stronger backend OOP programmers? Maybe a video creating the same game in a different language/framework would be cool
me be like; roses are red violet's are blue; your code is my property :) TIM BTW, i am sending dm in your discord please respond man i am waiting for months
Code in this video: github.com/techwithtim/Python-Aim-Trainer
i see tim , i click… simple
I am waiting for tim's videos with python
Same here
Thanks for what you do. I'd like to get the feel of the jobs offered out there. Can you go through what is requested in a job that you've done, from the beginning, what you have to interface with, to the end. This may be a good series for your channel. Thanks
At 29:13, I don’t see why you couldn’t swap the values inside the squaring operation. At least mathematically, it wouldn’t change anything. Does this have to do with implementation of math in Python, or was it simply to ensure readability/clarity?
Great code and useful logic. Thanks.
Tim content be 🔥🔥🔥🔥
Thnx Tim. Good job
Great content! I would like to ask you if pygame is still popular or arcade library (or another library) will take its place.
Thanks!
amazing, thanks so much!
There is an error in this code. If the user doesn't click at all and let its lives go to zero there is a ZeroDivisionError at the end_screen() when we try to calculate the user's accuracy. If someone wants to make the end_screen() more bulletproof try this:
def end_screen(win, analytics):
win.fill(BG_COLOR)
time_label = LABEL_FONT.render(f"Time: {format_time(analytics.elapsed_time)}", 1, "white")
speed = round(analytics.targets_pressed/analytics.elapsed_time, 1)
speed_label = LABEL_FONT.render(f"Speed: {speed} t/sec", 1, "white")
hits_label = LABEL_FONT.render(f"Hits: {analytics.targets_pressed}", 1, "white")
# This is the changed part
# ------------------------------------------------------------------------------------------------------------------------ #
try:
accuracy = round(analytics.targets_pressed / analytics.clicks * 100, 1)
except ZeroDivisionError as e:
accuracy = 0.0
# ------------------------------------------------------------------------------------------------------------------------ #
accuracy_label = LABEL_FONT.render(f"Accuracy: {accuracy}%", 1, "white")
exit_label = LABEL_FONT.render("Press any key to exit...", 1, "white")
win.blit(time_label, (center_label(time_label), 50))
win.blit(speed_label, (center_label(speed_label), 150))
win.blit(hits_label, (center_label(hits_label), 250))
win.blit(accuracy_label, (center_label(accuracy_label), 350))
win.blit(exit_label, (center_label(exit_label), 450))
pygame.display.update()
while True:
for event in pygame.event.get():
if (event.type == pygame.QUIT or
event.type == pygame.KEYDOWN):
quit()
Please please 🙏 Tim, can you add an AI feature or pinch industry grade algorithms to go a little bit deeper?
Next video: "I train an ai to play valorant and becomes pro in it using python"
(i hope you make it, any games will do) btw first third comment
I really hope he does
Hey Tim, Can you please point me yo the video where you listed all python topics graded as Begineer ,Intermediate etc. I checked the playlist several times but i could not find the List ,
Your content is awesome.
Thanks
👾👾👾👾👾👾👾👾👽👽👽👽👽👽👽🤖🤖🤖🤖🤖🤖🤖🤖👿👿👿👿👿💀☠☠☠☠☠💀☠☠☠💀💀💀☠☠☠💀☠
hello there..john from Africa
Nice!!
Hey Tim! Love the PyGame tutorials. Do you have advice for building web-deployable game applications? Is there a solution that’s optimal for those of us who are stronger backend OOP programmers? Maybe a video creating the same game in a different language/framework would be cool
I literally made this a few weeks ago haha
Nice..
Cool
Can you do some Deep learning projects ? Plz
Ask ChatGPT:
Write me an aim trainer game in python 😂 which Tech with Tim showed on 25th June 2023
How many years have you been studying coding?
Please continue Rust Course. Thank You
Can you post the code on github , 'cause I have an error and I can't find out what the problem is ?
Cn you explaiun "GROWTH_RATE", i am not clear
First
could someone show me some code for a play again button
import math
import random
import time
import pygame
pygame.init()
WIDTH, HEIGHT = 800, 600
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Adam's Aim Trainer")
TARGET_INCREMENT = 400
TARGET_EVENT = pygame.USEREVENT
TARGET_PADDING = 30
BG_COLOR = (0, 25, 40)
LIVES = 3
TOP_BAR_HEIGHT = 50
LABEL_FONT = pygame.font.SysFont("comicsans", 24)
class Target:
MAX_SIZE = 30
GROWTH_RATE = 0.2
COLOR = "red"
SECOND_COLOR = "white"
def __init__(self, x, y):
self.x = x
self.y = y
self.size = 0
self.grow = True
def update(self):
if self.size + self.GROWTH_RATE >= self.MAX_SIZE:
self.grow = False
if self.grow:
self.size += self.GROWTH_RATE
else:
self.size -= self.GROWTH_RATE
def draw(self, win):
pygame.draw.circle(win, self.COLOR, (self.x, self.y), self.size)
pygame.draw.circle(win, self.SECOND_COLOR, (self.x, self.y), self.size * 0.8)
pygame.draw.circle(win, self.COLOR, (self.x, self.y), self.size * 0.6)
pygame.draw.circle(win, self.SECOND_COLOR, (self.x, self.y), self.size * 0.4)
def collide(self, x, y):
dis = math.sqrt((self.x - x)**2 + (self.y - y)**2)
return dis
Tim can build aimlabs
Aim Training 😂
and by the way THX A LOT for not showing your face when you coding! (your not uggly but we don t need to see your face when coding
me be like;
roses are red violet's are blue; your code is my property :)
TIM BTW, i am sending dm in your discord please respond man i am waiting for months