Beispiel #1
0
    def __init__(self, width, height):
        self.mWidth = width
        self.mHeight = height

        self.skycolor = (0, 230, 255)

        self.mBoat = boat.Boat(width, height, self.skycolor)
Beispiel #2
0
godmode = False

#Pontos
score = 0
highscore_file = open('highscore.dat', "r")
highscore_int = int(highscore_file.read())

#NUVENS QUE PASSAM NO CENARIO
cloud_x = 800
cloud_y = random.randint(0, 400)

#VARIAVEIS DO INIMIGO
enemy_heli = enemy_heli.EnemyHeli(-100, display_height / 2 - 40)
enemy_heli_alive = False

boat = boat.Boat(-110, 430)
boat_alive = False
#NAVE ESPACIAL
spaceship_x = 800
spaceship_y = random.randint(0, 400)
spaceship_alive = False  # VIDAS
spaceship_hit_player = False
warning_once = True
warning = False  # MENSAGEM DE ATENÇAO
warning_counter = 0
warning_message = message_to_screen("!", font, 200,
                                    red)  # A COR DA MENSAGEM E O TAMANHO

#VARIAVEIS DOS BALOES
balloon_x = 800
balloon_y = random.randint(0, 400)
cannon balls splash in water

https://www.youtube.com/watch?v=SO7FFteErWs

'''
import boat, game_manager
from functions import *

pygame.init()

clock = pygame.time.Clock()
surface = pygame.display.set_mode((screen_width, screen_height))

gm = game_manager.GameManager()

player = boat.Boat('images/1stship_3.png', True, int(screen_width / 3))

done = False
while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True
        elif event.type == pygame.KEYDOWN:
            print(event.key)
            if event.key == pygame.K_ESCAPE:
                done = True
            elif event.key == pygame.K_UP:
                player.jump()
            elif event.key == 32:  #space bar
                #Shoot a cannonball
                gm.shoot(player, True)
Beispiel #4
0
Implement splash in the water.

https://www.youtube.com/watch?v=SO7FFteErWs

'''
import boat, game_manager
from functions import *

pygame.init()

clock = pygame.time.Clock()
surface = pygame.display.set_mode((screen_width, screen_height))

gm = game_manager.GameManager()

player = boat.Boat()

done = False
while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True
        elif event.type == pygame.KEYDOWN:
            print(event.key)
            if event.key == pygame.K_ESCAPE:
                done = True
            if event.key == 32:  #space bar
                player.jump()
        elif event.type == pygame.MOUSEBUTTONUP:
            pos = pygame.mouse.get_pos()
            shiftWaterHeight(pos, gm.water_heights)
cannon balls splash in water

https://www.youtube.com/watch?v=SO7FFteErWs

'''
import boat, game_manager
from functions import *

pygame.init()

clock = pygame.time.Clock()
surface = pygame.display.set_mode((screen_width,screen_height))

gm = game_manager.GameManager()

player = boat.Boat('images/1stship_3.png',True,int(screen_width/3))

#TODO TESTING
test_enemy = boat.Boat('images/2nd_ship_new_2.png',False,screen_width-300)
gm.enemy_boats.append(test_enemy)

done=False
while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True
        elif event.type == pygame.KEYDOWN:
            print(event.key)
            if event.key == pygame.K_ESCAPE:
                done = True
            elif event.key == pygame.K_UP: