예제 #1
0
def main():

    #load Data
    nebula_image = games.load_image("img/space.png", transparent=False)
    explosion_files = ["img/explosion1.bmp", "img/explosion2.bmp", "img/explosion3.bmp",
                       "img/explosion4.bmp", "img/explosion5.bmp", "img/explosion6.bmp",
                       "img/explosion7.bmp", "img/explosion8.bmp", "img/explosion9.bmp"]

    missile_sound = games.load_sound("sounds/laser.ogg")
    games.music.load("sounds/Erebus.ogg")

    #create objects
    the_ship = Ship()
    explosion = games.Animation(images=explosion_files,
                                x=games.screen.width/2,
                                y=games.screen.height/2,
                                n_repeats=5,
                                repeat_interval=5)

    #draw
    games.screen.background = nebula_image
    games.screen.add(the_ship)
    games.screen.add(explosion)


    #game setup

    #start loop
    games.screen.mainloop()
예제 #2
0
def main():

    # load data
    space_image = games.load_image("images/background.png", transparent=False)
    explosion_files = [
        "animations/explosion1.png",
        "animations/explosion2.png",
        "animations/explosion3.png",
        "animations/explosion4.png",
        "animations/explosion5.png",
        "animations/explosion6.png",
        "animations/explosion7.png",
        "animations/explosion8.png",
    ]
    ##missle_sound = games.load_sound("")
    games.music.load("Music/03 Chibi Ninja.mp3")

    # create objects
    the_ship = Ship()
    explosion = games.Animation(images=explosion_files,
                                x=games.screen.width / 2,
                                y=games.screen.height / 2,
                                n_repeats=0,
                                repeat_interval=4)

    # draw
    games.screen.background = space_image
    games.screen.add(the_ship)
    games.screen.add(explosion)

    # games setup
    games.music.play("Music/03 Chibi Ninja.mp3")

    # start loop
    games.screen.mainloop()
예제 #3
0
def main():
    # load data
    bg_image = games.load_image("images/background.png", transparent = False)
    ship_explosion_files = ["animations/ship_explode/ship.png",
                            "animations/ship_explode/ship1.png",
                            "animations/ship_explode/ship2.png",
                            "animations/ship_explode/ship3.png",
                            "animations/ship_explode/ship4.png",
                            "animations/ship_explode/ship5.png",
                            "animations/ship_explode/ship6.png",
                            "animations/ship_explode/ship7.png",
                            "animations/ship_explode/ship8.png",
                            "animations/ship_explode/ship9.png",
                            "animations/ship_explode/ship10.png",
                            "animations/ship_explode/ship11.png",
                            "animations/ship_explode/ship12.png",
                            "animations/ship_explode/ship13.png",
                            ]

    # create objects
    player = Ship()
    explosion = games.Animation(images = ship_explosion_files,
                                x = games.screen.width/2,
                                y = games.screen.height/2,
                                n_repeats = 0,
                                repeat_interval = 1)

    # draw to screen
    games.screen.background = bg_image
    games.screen.add(player)
    games.screen.add(explosion)
    
    # game setup
    
    games.screen.mainloop()
예제 #4
0
def main():

    #load data
    bg_img = games.load_image("sprites/background.png", transparent=False)
    explosion_files = [
        "sprites/explosion1.png", "sprites/explosion2.png",
        "sprites/explosion3.png", "sprites/explosion4.png",
        "sprites/explosion5.png", "sprites/explosion6.png",
        "sprites/explosion7.png"
    ]

    #asteroid = games.load_image("sprites/asteroid1.png", transparent = False)

    #create objects
    player = Ship()
    explosion = games.Animation(
        images=explosion_files,
        x=games.screen.width / 2,
        y=games.screen.height / 2,
        n_repeats=0,
        repeat_interval=10,
    )
    #transparent = True)

    #draw to screen
    games.screen.background = bg_img
    games.screen.add(player)
    games.screen.add(explosion)
    #games.screen.add(asteroid)

    #game setup

    games.screen.mainloop()
예제 #5
0
def main():

    # load data
    background = games.load_image("img/space.png", transparent=False)
    explosion_files = [
        "img/explosion1.png", "img/explosion2.png", "img/explosion3.png",
        "img/explosion4.png", "img/explosion5.png"
    ]

    #laser_sound = games.load_sound("snd/laser_Shoot.wav")
    #games.music.load("snd/tgfcoder-FrozenJam-SeamlessLoop.ogg")

    # create objects
    the_ship = Ship()
    explosion = games.Animation(images=explosion_files,
                                x=games.screen.width / 2,
                                y=games.screen.height / 2,
                                n_repeats=1,
                                repeat_interval=5)

    # draw
    games.screen.background = background
    games.screen.add(the_ship)
    games.screen.add(explosion)

    # game_setup

    # start loop
    games.screen.mainloop()
예제 #6
0
def main():

    #load data
    bg_image = games.load_image("images/background.jpg",transparent = False)
    explosion_files = ["images/explosion1.bmp",
                                   "images/explosion2.bmp",
                                   "images/explosion3.bmp",
                                   "images/explosion4.bmp",
                                   "images/explosion5.bmp"]

    missile_sound = games.load_sound("sounds/missile.wav")
    games.music.load("sounds/gamenoise.mp4")
    
    
    #create objects
    the_ship = Ship()
    explosion = games.Animation(images = explosion_files,
                                                        x = games.screen.width/2,
                                                        y = games.screen.height/2,
                                                        n_repeats = 0,
                                                        repeat_interval = 4)
    #draw
    games.screen.background = bg_image
    games.screen.add(the_ship)
    games.screen.add(explosion)
    #game setup

    #start loop
    games.screen.mainloop()
예제 #7
0
def main():

    #load data
    nebula_image = games.load_image("images2/Space.jpg", transparent=False)
    explosion_files = [
        "images2/e1.jpg", "images2/e2.jpg", "images2/e3.jpg", "images2/e4.jpg",
        "images2/e5.jpg", "images2/e6.jpg", "images2/e7.jpg", "images2/e8.jpg"
    ]

    #create objects
    the_ship = Ship()
    explosion = games.Animation(images=explosion_files,
                                x=games.screen.width / 2,
                                y=games.screen.width / 2,
                                n_repeats=0,
                                repeat_interval=5)

    #draw objects
    games.screen.background = nebula_image
    games.screen.add(the_ship)
    games.screen.add(explosion)

    #games setup

    #start loop
    games.screen.mainloop()
예제 #8
0
def main():
    background_img = games.load_image("Images/stars.png", transparent=False)
    explosion_files = [
        "Images/explosion(1).png", "Images/explosion(2).png",
        "Images/explosion(3).png", "Images/explosion(4).png",
        "Images/explosion(5).png"
    ]
    steve_img = Steve()
    explosion = games.Animation(images=explosion_files,
                                x=games.screen.width / 2,
                                y=games.screen.height / 2,
                                n_repeats=1,
                                repeat_interval=3)
    games.screen.add(steve_img)
    games.screen.add(explosion)
    games.screen.background = background_img
    games.screen.mainloop()
예제 #9
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Взрыв
# Демонстрирует создание анимации
from superwires import games
games.init(screen_width=640, screen_height=480, fps=50)
nebula_image = games.load_image("nebula.jpg", transparent=0)
games.screen.background = nebula_image
explosion_files = [
    "explosion1.bmp", "explosion2.bmp", "explosion3.bmp", "explosion4.bmp",
    "explosion5.bmp", "explosion6.bmp", "explosion7.bmp", "explosion8.bmp",
    "explosion9.bmp"
]
explosion = games.Animation(images=explosion_files,
                            x=games.screen.width / 2,
                            y=games.screen.height / 2,
                            n_repeats=1,
                            repeat_interval=3)
games.screen.add(explosion)
games.screen.mainloop()