I want to make a flappy bird game and make the screen fit to the size of output box but:
Repl link:
what i tried is using os.get_terminal _size but then it makes the output really small
import pgzrun
import os
WIDTH = os.get_terminal_size().columns
HEIGHT = os.get_terminal_size().lines
brick = Actor("brick")
brick.x = 90
brick.y = 250
def draw():
brick.draw()
pgzrun.go()```
Interesting problem!
I took a look and worked through the start of the tutorial. I had the same issue but noticed that pyflakes had underlined the Actor command.
After some searching I found that if you add the following line after import pgzrun
it should work:
from pgzero.builtins import Actor, animate, keyboard
so it will fit too the size of the output box
I’m not sure what you are saying here @PrestonCurtis1 . Did the above suggestion not help you display the brick image? Or now that it is displaying, the size is still small?
I think that maybe you are using incorrect values to get the screen size. You are trying to get the terminal size which is the console
window as far as I’m aware.
Could you try this instead?
infoObject = pygame.display.Info()
pygame.display.set_mode((infoObject.current_w, infoObject.current_h))
You would also have to import pygame
for the above code to work.
1 Like
Hi @PrestonCurtis1 did the above suggestion help you solve your issue?
1 Like
yeah it did @IanAtCSTeach thanks
1 Like
system
Closed
December 25, 2022, 9:50pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.