예제 #1
0
def main():
    fl = open("assets/txt/SCORE.txt", "w")
    fl.write("0")
    fl.close()
    window_size = (1000, 750)
    title = "Space Reinvaders"
    g = Game(window_size, title)
    g.run()
예제 #2
0
    def render(self):
        from engine.game_env import Game
        Game.get_surface().fill(self.bg)

        for br in self.bricks:
            br.render()

        self.ball.render()
        self.paddle.render()
예제 #3
0
    def update(self, delta_ms):
        from engine.game_env import Game
        left = Game.get_key(K_a) or Game.get_key(K_LEFT)
        right = Game.get_key(K_d) or Game.get_key(K_RIGHT)

        if left:
            self.rect.centerx -= int(self.x_vel * delta_ms)
        if right:
            self.rect.centerx += int(self.x_vel * delta_ms)
예제 #4
0
    def render(self):
        #Week 12 addition
        if self.game_over:
            self.bg = self.bg_won if self.game_won else self.bg_lost
        #Week 12 addition end

        from engine.game_env import Game
        Game.get_surface().fill(self.bg)

        for br in self.bricks:
            br.render()

        self.ball.render()
        self.paddle.render()
예제 #5
0
 def render(self):
     if self.active:
         from engine.game_env import Game
         Brick.surf.fill(self.colour)
         Game.get_surface().blit(Brick.surf, self.rect)
예제 #6
0
파일: app.py 프로젝트: HerculesDC/MultiGame
def main():
    g = Game()
    g.run()
    sys.exit()
예제 #7
0
def main():
    window_size = (1024, 768)
    title = "Game"
    g = Game(window_size, title)

    g.run()
예제 #8
0
 def render(self):
     from engine.game_env import Game
     Game.get_surface().blit(self.surf, self.rect)
예제 #9
0
def main():
    g = Game(1024, 768, "my first pygame-engine")
    g.run()
예제 #10
0
 def launch_ball(self):
     from pygame.locals import K_SPACE
     from engine.game_env import Game
     if Game.get_key(K_SPACE):
         self.ball.launch()
예제 #11
0
def main():
    g = Game()
    g.run()
예제 #12
0
 def render(self):
     from engine.game_env import Game
     Game.get_surface().fill(self.bg)
예제 #13
0
def main():
    title = 'Game'
    window_size = (1280, 720)

    game = Game(window_size, title)
    game.run()