pip install PySFML
python
import sfml
python
window = sfml.RenderWindow(sfml.VideoMode(800, 600), "My Game")
python
window.framerate_limit = 60
python
running = True
while running:
for event in window.events:
if type(event) == sfml.CloseEvent:
running = False
window.display()
python
if sfml.Keyboard.is_key_pressed(sfml.Keyboard.LEFT):
if sfml.Keyboard.is_key_pressed(sfml.Keyboard.RIGHT):
if sfml.Keyboard.is_key_pressed(sfml.Keyboard.UP):
if sfml.Keyboard.is_key_pressed(sfml.Keyboard.DOWN):
if sfml.Keyboard.is_key_pressed(sfml.Keyboard.SPACE):
python
# ...
window.display()