I'm using replit as my IDE, and I installed everything correctly. for some reason, when I run the code, it says it's running but has no pygame window in the display tab.
my code:
import pygame
import pymunk
from pymunk import pygame_util
from classes import *
from constants import *
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock()
running = True
space = pymunk.Space()
space.gravity = 0, gravity
draw_options = pygame_util.DrawOptions(screen)
player1 = player(100, 100, ("blue_player.png", "blue_player_hold.png"))
space.add(player1.body, player1.shape)
while running:
space.step(1 / 60)
clock.tick(60)
screen.fill("white")
for event in pygame.event.get():
...
space.debug_draw(draw_options)
pygame.display.flip()
1 Answer 1
I'm not sure but when I created new project with PyGame then it didn't show it in Display
or Preview
tab but it opened tab VNC
to redirect PyGame window to browser.
You can find it in +
which opens new tab:
Wikipedia: VNC (for Virtual Network Computing
)
answered Oct 8 at 14:00
Sign up to request clarification or add additional context in comments.
Comments
lang-py
replit
needs special version of Python to display` PyGame` inweb browers
becausepygame
wasn't created to work in web browser