Just found your videos... you are the only 1 who explain things so well and i can understand , thank you
@ScriptLineStudios3 жыл бұрын
Happy to hear that! Thanks for the motivation :D
@shapeletter2 жыл бұрын
Nice video, good tempo! :) For the scrolling bullets, you could store the display_scroll as old_display_scroll when you create the bullet, and then... `bullet.x = old_display_scroll[0] - display_scroll[0] + travel_distance_x`
@seanbisset47503 жыл бұрын
Dude how old are you?? I'm 31 still learning and I'm in awe on youngsters who are so competent in code!! I wish I had learnt it when I was young.
@ScriptLineStudios3 жыл бұрын
I am 14 but don't worry I believe its never too late to start!
@pygame59363 жыл бұрын
@@ScriptLineStudios i am 12 i am still learning but need so much to learn ,,,,, cool toturials bro
@oubracode3 жыл бұрын
@@pygame5936 me to loll haha
@Superfastisfast3 жыл бұрын
@@ScriptLineStudios hi I’m 9 (: guess we’re close
@The.Radiance2 жыл бұрын
@@ScriptLineStudios same bro
@legendrags2 жыл бұрын
thank you so much, i was searching for how to move the bullet in any direction. You helped me a lot!
@itspyguru3 жыл бұрын
Whoaaa, amazing work buddy 👏👏👏
@DevNugget3 жыл бұрын
Looking at the first few minutes of the video, seems like a great tutorial.. I will save this for later because im definitely going to be trying pygame soon!
@ScriptLineStudios3 жыл бұрын
Good luck with Pygame! Once again thanks for the awesome thumbnail!
@DevNugget3 жыл бұрын
@@ScriptLineStudios 👍
@lunar8258 Жыл бұрын
when i shoot the bullet sometimes it creates a line on my screen, why is that?
@RoboMarchello3 жыл бұрын
Great tutorial! When you speak while coding it relaxes me XD
@ScriptLineStudios3 жыл бұрын
Thank you! Glad you enjoyed :D
@justalunatic3 жыл бұрын
8:20 - um.. what WAS THT " hm aahahe"
@TheChristIsKing3 жыл бұрын
Looking forward to part 2. I'm going to use this to teach my 6 yo son. Thank you!
@ScriptLineStudios3 жыл бұрын
Thank you! I hope he enjoys it :D Part 2 should be coming this weekend
@oubracode3 жыл бұрын
@@ScriptLineStudios You DOING Really Good work, KEEP GOING!!!
@PurpleGecko66 ай бұрын
Love the video, you have earned my sub
@sorzak_kriv81432 жыл бұрын
there should be a volume button for keyboards great tutorial tho!
@rinkaudenaerde82423 жыл бұрын
i have a problem. when i click, the game ends. how do i fix this?
@peterheile77392 жыл бұрын
Thank you so much! This really helped me get started and understand the basic so hopefully I can do well on my creations in the future!
@Acrowbatics1003 жыл бұрын
I WAS LOOKING FOR THIS!!!! KEEP UP GOOD WORK
@birbylikesfox10323 жыл бұрын
amogus
@kazurapozdro3 жыл бұрын
how do you make like a smooth camera follow? like a delay and smooth follow back to the player
@nowifi32662 жыл бұрын
Amazing, just what I needed, ty!
@niilokolehmainen34532 жыл бұрын
Good video! If there is something you should make better it is you keyboard voice.
@mitchelljones2452 Жыл бұрын
I'm running into a bug where anytime I shoot a ball off the left side of the screen, the ball stretches across the screen making a line. I've had this happen on a couple different codiing projects and can never figure out why, has anyone else run into this problem?
@ryanbaybutt2134 Жыл бұрын
Yeah i got the same problem ??. I just added an if statement at the end of the game loop where the bullets for loop is, if bullet.x < 25: player_bullets.remove(bullet) makes it work better but still really weird.
@furtnite3913 Жыл бұрын
@@ryanbaybutt2134why does it work now? Why 25
@edward29083 жыл бұрын
Fuckin hell the red cube is shooting my sprite
@creativedogeMC3 жыл бұрын
Almost to 1000 subs! LET'S GOOOOOOOOOOOOOOOO
@mlody4ever2 жыл бұрын
for screen resolution i reccomend this code: HEIGHT = 1280 WIDTH = 720 It's easier to understand, and with that knowledge you can define custom screen resolution, that player can easily input in game options or via debug console.
@fumano26792 жыл бұрын
My screen has only 1080 height and not 1280 😭
@awesomegamercz Жыл бұрын
I'm having an issue like the one described in some of the other comments. Any time I fire a bullet to the left side of the screen, that whole line will fill with the bullet.
@furtnite3913 Жыл бұрын
Have you fixed it? Same problem here
@siriuslemaitre48333 жыл бұрын
"pygame.Surface' object attribute 'scroll' is read-only" this is a message i've got when I run the game for this line of script : display.scroll = [0,0] can someone help me?
@ScriptLineStudios3 жыл бұрын
Looks like you have accidentally said display.scroll instead of display_scroll :D
@siriuslemaitre48333 жыл бұрын
@@ScriptLineStudios OMG thanks you so much its been one day i'm searching for the solution xD
@dekriel1192 жыл бұрын
width and height and speed not defined?
@tranzistor40932 жыл бұрын
Your keyboard is best!
@hiddebeast5166 Жыл бұрын
i cant change the color
@AeSoG_Youtube Жыл бұрын
SOurce?
@siriuslemaitre48333 жыл бұрын
very interesting tutorial, but the sound of your keyboard is a little annoying o~o. great video, continue in this way!
@ScriptLineStudios3 жыл бұрын
Thanks for the feedback :D
@catloafl2 жыл бұрын
The code for exiting at 3:09 is wrong, you want to use pygame.quit() to run exiting the app, the only reason why it closes properly is because you have sys.exit(), so pygame.QUIT does nothing for actually closing the app. Also you don't need sys to exit the pygame window, you just need to use pygame.quit() (all lowercase, the UPPERCASE pygame.QUIT is an event, while pygame.quit() is a method)
@---sb3sr2 жыл бұрын
You still need sys.exit() to quit the program as pygame.quit() only leaves the game, the while loop will still go on.
@grimblegromble84692 жыл бұрын
I'm getting this error, and I cannot figure out how to solve it :( : line 45, in mouse_x, mouse_y == pygame.mouse.get_pos() NameError: name 'mouse_x' is not defined
@m-danya-3272 жыл бұрын
Change the "==" to "=". Right now you're trying to check for equality (with "==") a tuple of two varibles (mouse_x, mouse_y) with the value of pygame.mouse.get_pos(), and Python tries to get the values of these variables, but they are not defined. You want to define them instead of doing all of these, so just use "="
@apexlegends31682 жыл бұрын
Gets that fired bullets will always exist. You need to delete them after they go beyond the screen. Why don't you use groups instead of putting bullets in a simple list? for bullet in player_bullets: bullet.main(screen) if bullet.y < 0 or bullet.y > SCREEN_HEIGHT or bullet.x < 0 or bullet.x > SCREEN_WIDTH: del player_bullets[-1]
@fdevstudio56923 жыл бұрын
Hi, you know dafluffypotato?
@ScriptLineStudios3 жыл бұрын
Yes, they are one of my inspirations
@eobondarenko27533 жыл бұрын
Спасибо
@mopar_stolecar2 жыл бұрын
How do I download pygame?!?
@sine7687 Жыл бұрын
It 's really useful.
@v69hz823 жыл бұрын
Good tutorial, it's just that it's been 1 month since you uploaded the second part
@v69hz823 жыл бұрын
can't wait for the second part xd
@hoimenam53813 жыл бұрын
were can you get the pack?
@ScriptLineStudios3 жыл бұрын
Its in the description of the second part to this series :D
@hoimenam53813 жыл бұрын
@@ScriptLineStudios ok thanks (:
@eyeofcthulhu5262 жыл бұрын
it says pygame doesn't exist
@teo11300 Жыл бұрын
great tutorial!
@andrewcathcart3 жыл бұрын
Your intellisense looks pretty bad here. What IDE are you using? Seems like a pain not having decent autocomplete.
@v69hz823 жыл бұрын
She's using ATOM
@jawas41813 жыл бұрын
Bro, very good video.
@seansteusloff39183 жыл бұрын
hey, pretty new to coding, does anyone know what might be a common reason the white square wont move? Ik that's pretty vague but I cant figure it out and figured I might as well ask lol
@ScriptLineStudios3 жыл бұрын
Hey! could you maybe post your code here, would love to take a look and help you out
@seansteusloff39183 жыл бұрын
@@ScriptLineStudios yup! btw I really appreciate the help really cool of you! might look a little weird after the copy paste but here's what I have import pygame import sys import math pygame.init() display = pygame.display.set_mode((800, 600)) clock = pygame.time.Clock() class Player: def __init__(self, x, y, width, height): self.x = x self.y = y self.width = width self.height = height def main(self, display): pygame.draw.rect(display, (255, 0, 0), (self.x, self.y, self.width, self.height)) player = Player(400, 300, 32, 32) display_scroll = [0,0] while True: display.fill((24, 164, 86)) for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.QUIT sys.exit() keys = pygame.key.get_pressed() pygame.draw.rect(display, (255, 255, 255), (100-display_scroll[0], 100-display_scroll[1], 16, 16)) if keys[pygame.K_a]: display_scroll[0] -= 5 if keys[pygame.K_d]: display_scroll[0] += 5 if keys[pygame.K_w]: display_scroll[1] -= 5 if keys[pygame.K_s]: display_scroll[1] += 5 player.main(display) clock.tick(60) pygame.display.update()
@Nico-xs2lq3 жыл бұрын
@@seansteusloff3918 if u didnt understand, the problem may be because its an illusion, you are the middle square, if u look at it, its going to look like the middle square its moving, you welcome(maybe)
@mousiedev78833 жыл бұрын
Bugs: Swap the lines sys.exit() and pygame.QUIT Change this ^ pygame.QUIT to pygame.quit() Cosmetic: The keyboard is pretty loud Video and sound out of sync Having global variables can result in badly managable code You should put the init stuff & main loop to its own function For the bullets, you can predict the trajectory of where they will go and just move it on the trajectory (might be overkill though)
@ScriptLineStudios3 жыл бұрын
Thank you for the feedback! I will fix the bugs and take your suggestions into account for part 2 of this series!
@mousiedev78833 жыл бұрын
@@ScriptLineStudios no problem!
@papiangelus3 жыл бұрын
Ayo, where's the art assets lmao
@hoimenam53813 жыл бұрын
i dont know ether
@mariozaldivar78023 жыл бұрын
Great video!!!
@ScriptLineStudios3 жыл бұрын
Thank you!!
@jkewlo3 жыл бұрын
Got a subbbbbb from me
@ScriptLineStudios3 жыл бұрын
Thank you!!
@rangerconstruct3474 Жыл бұрын
I have an issue where when I click above the player, the bullets fire from below, and vice versa. This is not an issue for when I click to the right or left of the player. I feel this is to do with the math.cos/math.y part, as when I change it, results differ but don’t fix.
@The.Radiance2 жыл бұрын
My code is broken!! it gives me this error about the variable of speed being a tuple and not an integer File "/home/radioactivethirst/PyCode/zombiesurvival.py", line 55, in pistol_bullets.append(PistolBullet(player.x, player.y, mouse_x, mouse_y)) File "/home/radioactivethirst/PyCode/zombiesurvival.py", line 29, in __init__ self.x_vel = math.sin(self.angle) * self.speed TypeError: must be real number, not tuple What does this mean and how do I fix it?