Giter Site home page Giter Site logo

ultimatepygameintro's People

Contributors

clear-code-projects avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ultimatepygameintro's Issues

Image naming convention

Sky.png and ground.png are the names used in the graphics folder. The difference in capitalization convention may throw off new programmers.

(Fantastic video by the way- this is the gold standard I'll be measuring other coding tutorials against from now on)

Enlarging score_rect no longer works

At approx 1:21:00 in the tutorial a pink rect is drawn behind the score and a second one is drawn as an outlined rectangle to make it larger. This worked because the border was drawn half inside and half outside the rect. This no longer works.

From the pygame site:
"Changed in pygame 2.1.1: Drawing rects with width now draws the width correctly inside the rect's area, rather than using an internal call to draw.lines(), which had half the width spill outside the rect area."

A possible alternative could be something like:
pygame.draw.rect(screen,'Pink',score_rect.inflate(20,20))

This seems to draw an inflated box without permanently affecting the size of score_rect. I used a second pygame.draw() to confirm this by drawing score_rect in red without the inflate(). (Sorry, n00b here so I'm discovering as I write).

TypeError: 'pygame.surface.Surface' object is not callable

I don't know if my code is wrong but when I run it, it said that. Here's my code:
`import pygame
from sys import exit

pygame.init()
screen = pygame.display.set_mode((800, 400))
pygame.display.set_caption('Runner')
clock = pygame.time.Clock()
test_font = pygame.font.Font('Pixeltype.ttf', 50)

sky_surface = pygame.image.load('Sky.png').convert()
ground_surface = pygame.image.load('ground.png').convert()
test_surface = test_font.render('My game', False, 'Black')

snail_surface = pygame.image.load('snail1.png').convert_alpha()
snail_x_pos = 600

player_surf = pygame.image.load('player_walk_1.png').convert_alpha()

while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit()

screen.blit(sky_surface, (0, 0))
screen.blit(ground_surface, (0, 300))
screen.blit(test_surface, (300, 50))
snail_x_pos -= 4
if snail_x_pos < -100: snail_x_pos = 800
screen.blit(snail_surface, (snail_x_pos, 250))
screen.blit(player_surf(60,200))

pygame.display.update()
clock.tick(60)`

I'm currently using PyCharm Community Edition 2023.1.3.

screen size fix

make the screen on the game any size instead of a fixed size.

screen = pygame.display.set_mode((800,400),pygame.RESIZABLE)

Fix paths

Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/home/emsi/PycharmProjects/UltimatePygameIntro/runner_class only.py", line 106, in <module>
    player.add(Player())
  File "/home/emsi/PycharmProjects/UltimatePygameIntro/runner_class only.py", line 8, in __init__
    player_walk_1 = pygame.image.load('graphics/player/player_walk_1.png').convert_alpha()
FileNotFoundError: No file 'graphics/player/player_walk_1.png' found in working director```

Clearly there is no player directory. It is Player .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.