Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
with GameEngine(Game, resolution=(400, 600)) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(800, 800)) as engine:
engine.run()
from ppb import GameEngine, BaseScene
with GameEngine(BaseScene) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(400, 600)) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(800, 800)) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(400, 600)) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(800, 800)) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(400, 600)) as engine:
engine.run()
def main():
with GameEngine(Game, resolution=(400, 600)) as engine:
engine.run()
def simulate(self, time_delta):
self.rect.centery += -10
class Enemy(BaseGameObject):
image_path = "enemy.png"
def __init__(self, scene, x_position):
super().__init__(scene, (x_position, 0))
def simulate(self, time_delta):
self.rect.centery += 3
class Game(BaseScene):
def __init__(self, engine, background_color=(90, 55, 100), **kwargs):
super().__init__(engine=engine,
background_color=background_color,
**kwargs)
Player(self)
Bullet(self, (0, 0)).kill()
self.spawner = Spawner(self, file_spawner("spawn.csv"), Enemy)
def simulate(self, time_delta):
super().simulate(time_delta)
self.spawner.spawn(time_delta)
player = self.groups[Player.group]
bullets = self.groups[Bullet.group]