Ejemplo n.º 1
0
    def __init__(self):
        director.set_clear_color(COLOR_WHITE);

        ## Logo
        self._logo     = assets.load_image("AmazingCow_Logo_Big.png");
        logo_size      = self._logo.get_size();
        self._logo_pos = (GAME_WIN_CENTER_X - logo_size[0] * 0.5,
                          GAME_WIN_CENTER_Y - logo_size[1]); ## A bit above center

        ## Text
        self._text = Text(FONT_NAME, FONT_SIZE + 15,
                         -1, -1,  ## Dummy values.
                         "amazingcow", COLOR_BLACK);
        text_size = self._text.get_size();
        self._text.set_position(
            GAME_WIN_WIDTH  * 0.5 - text_size[0] * 0.5,
            self._logo_pos[1] + logo_size[1] + 20,
        );

        ## Timer
        self._timer = CowClock(0.4, 5, self._on_timer_tick, self._on_timer_done);
        self._timer.start();

        ## Others
        self._curr_rgb = list(COLOR_WHITE);
        self._dst_rgb  = (random.randint(0, 255),
                          random.randint(0, 255),
                          random.randint(0, 255));

        self._update_colors = False;
Ejemplo n.º 2
0
    def __init__(self):
        director.set_clear_color(COLOR_WHITE)

        ## Logo
        self._logo = assets.load_image("AmazingCow_Logo_Big.png")
        logo_size = self._logo.get_size()
        self._logo_pos = (GAME_WIN_WIDTH * 0.5 - logo_size[0] * 0.5,
                          GAME_WIN_HEIGHT * 0.5 - logo_size[1])
        ## A bit above center

        ## Text
        self._text = Text(
            FONT_NAME,
            FONT_SIZE + 15,
            -1,
            -1,  ## Dummy values.
            "amazing cow labs",
            COLOR_BLACK)
        text_size = self._text.get_size()
        self._text.set_position(
            GAME_WIN_WIDTH * 0.5 - text_size[0] * 0.5,
            self._logo_pos[1] + logo_size[1] + 20,
        )

        ## Timer
        self._timer = CowClock(0.4, 5, self._on_timer_tick,
                               self._on_timer_done)
        self._timer.start()

        ## Others
        self._curr_rgb = list(COLOR_WHITE)
        self._dst_rgb = (random.randint(0, 255), random.randint(0, 255),
                         random.randint(0, 255))

        self._update_colors = False
Ejemplo n.º 3
0
    def __init__(self):
        director.set_clear_color(COLOR_BLACK);

        wcenter = (GAME_WIN_WIDTH * 0.5);

        ## RamIt Logo.
        self._ram_it_logo      = assets.load_image("RamIt_Logo.png");
        self._ram_it_logo_size = self._ram_it_logo.get_size();
        self._ram_it_logo_pos  = (wcenter - (self._ram_it_logo_size[0] * 0.5),
                                  150);

        ## Play
        self._play_text = Text(FONT_NAME, 40, -1, -1, "Play");
        play_size = self._play_text.get_size();
        self._play_text.set_position(wcenter - (play_size[0] * 0.5),
                                      250);

        ## Credits
        self._credits_text = Text(FONT_NAME, 40, -1, -1, "Credits");
        credits_size = self._credits_text.get_size();
        self._credits_text.set_position(wcenter - (credits_size[0] * 0.5),
                                        350);

        ## AmazingCow
        self._amazingcow_text = Text(FONT_NAME, FONT_SIZE, -1, -1, "amazingcow - 2016");
        amazing_size = self._amazingcow_text.get_size();
        self._amazingcow_text.set_position(wcenter - (amazing_size[0] * 0.5),
                                           GAME_WIN_HEIGHT - (amazing_size[1] + 20));

        ## Selection
        self._curr_selection = -1;
        self._update_selection(1, play_sound = False); ## Force the blinking on play...
Ejemplo n.º 4
0
    def __init__(self):
        director.set_clear_color(COLOR_BLACK)

        ## Housekeeping
        self._game_state = GameScene._STATE_PLAYING

        ## Game Field
        self._game_field = assets.load_image("GameField.png")
        game_field_size = self._game_field.get_size()
        self._game_field_pos = [
            GAME_WIN_CENTER_X - game_field_size[0] * 0.5,
            GAME_WIN_CENTER_Y - game_field_size[1] * 0.5,
        ]

        game_field_size = self._game_field.get_size()

        ## Taz Min
        taz_field_min = copy.deepcopy(self._game_field_pos)
        taz_field_min[0] += GameScene._TAZ_X_OFFSET
        taz_field_min[1] += GameScene._TRACK_OFFSET
        ## Taz Max
        taz_field_max = copy.deepcopy(self._game_field_pos)
        taz_field_max[0] += game_field_size[0] - GameScene._TAZ_X_OFFSET
        taz_field_max[1] += game_field_size[1] - GameScene._TRACK_OFFSET

        ## Enemy Min
        enemy_field_min = copy.deepcopy(self._game_field_pos)
        enemy_field_min[1] += GameScene._TRACK_OFFSET
        ## Enemy Max
        enemy_field_max = copy.deepcopy(self._game_field_pos)
        enemy_field_max[0] += game_field_size[0] - GameScene._TAZ_X_OFFSET
        enemy_field_max[1] += game_field_size[1]

        ## Taz
        self._taz = Taz(
            min_bounds=taz_field_min,
            max_bounds=taz_field_max,
            tracks_count=GameScene._TRACKS_COUNT,
            track_offset=GameScene._TRACK_OFFSET,
            is_playable=True,
            dead_animation_callback=self._on_taz_dead_animation_done,
        )

        ## Enemies
        self._enemies = []
        for i in xrange(0, GameScene._TRACKS_COUNT):
            self._enemies.append(
                Enemy(
                    min_bounds=enemy_field_min,
                    max_bounds=enemy_field_max,
                    tracks_count=GameScene._TRACKS_COUNT,
                    track_offset=GameScene._TRACK_OFFSET,
                    track_index=i,
                )
            )

        ## Hud
        self._hud = Hud(taz_field_min, taz_field_max)
Ejemplo n.º 5
0
    def __init__(self):
        ##
        director.set_clear_color(COLOR_WHITE);

        ## Logo
        self.logo     = assets.load_image("AmazingCow_Logo_Small.png");
        logo_size     = self.logo.get_size();
        self.logo_pos = ((GAME_WIN_WIDTH * 0.5) - (logo_size[0] * 0.5), 15);

        color_surface(
            self.logo,
            director.randint(0, 255),
            director.randint(0, 255),
            director.randint(0, 255)
        );


        ## Message
        msg = [
            "This remake was made with <3 by Amazing Cow.",
            "We hope that you enjoy this little game (!)"
            "",
            "We have other projects at:",
            "www.amazingcow.com",
            "",
            "This game is entirely FREE SOFTWARE",
            "This means that you're welcome to",
            "SHARE and HACK IT (!!!)",
            "",
            "You can find the sources at:",
            "opensource.amazingcow.com",
            "",
            "Dev / Graphics / Sound by N2OMatt",
            "",
            "THANKS FOR PLAYING...",
            "",
            "The CCV helps people not commit suicide.",
            "Their work is very, very important.",
            "Why don't you help them?",
            "www.cvv.org.br"
        ];

        self.texts   = [];
        start_offset = self.logo_pos[1] + logo_size[1] + 5;
        line_offset  =  16;

        for i in xrange(0, len(msg)):
            text = Text("SourceCodePro-Regular.ttf", line_offset,
                        -1, -1,
                        msg[i], COLOR_BLACK);
            text_size = text.get_size();

            text.set_position(
                (GAME_WIN_WIDTH * 0.5) - (text_size[0] * 0.5),
                start_offset + (i * line_offset)
            );

            self.texts.append(text);
Ejemplo n.º 6
0
    def __init__(self):
        ##
        director.set_clear_color(COLOR_WHITE);

        ## Logo
        self.logo     = assets.load_image("AmazingCow_Logo_Small.png");
        self.logo_pos = ((GAME_WIN_WIDTH * 0.5) - (self.logo.get_width() * 0.5),
                         20);

        color_surface(
            self.logo,
            random.randint(0, 255),
            random.randint(0, 255),
            random.randint(0, 255)
        );


        ## Message
        msg = [
            "This remake was made with <3 by Amazing Cow Labs.",
            "We hope that you enjoy this little game (!)"
            "",
            "We have other projects at:",
            "www.amazingcow.com",
            "Take a look :)",
            "",
            "This game is entirely FREE SOFTWARE",
            "This means that you're welcome to",
            "SHARE and HACK IT (!!!)",
            "",
            "You can find the sources at:",
            "opensource.amazingcow.com",
            "",
            "Dev / Graphics / Sound by N2OMatt",
            "","",
            "THANKS FOR PLAYING..."
            "", "", "",
            "APAE do a wonderful job helping exceptional people",
            "Why you don't look and help their work? <3",
            "www.apaebrasil.org.br"
        ];

        self.texts   = [];
        start_offset = 140;
        line_offset  =  20;

        for i in xrange(0, len(msg)):
            text      = Text("SourceCodePro-Regular.ttf", 20, -1, -1, msg[i], COLOR_BLACK);
            text_size = text.get_size();

            text.set_position(
                (GAME_WIN_WIDTH * 0.5) - (text_size[0] * 0.5),
                start_offset + (i * line_offset)
            );

            self.texts.append(text);
Ejemplo n.º 7
0
    def __init__(self):
        director.set_clear_color(COLOR_WHITE);

        wcenter = (GAME_WIN_WIDTH * 0.5);

        ## Logo
        self._logo     = assets.load_image("Taz_Logo.png");
        logo_size      = self._logo.get_size();
        self._logo_pos = (wcenter - (logo_size[0] * 0.5), 20);

        ########################################################################
        ## COWTODO: WE REALLY NEED TO IMPROVE THE INTERFACE                   ##
        ## FOR CREATE AND SETUP TEXTS... IT SUCKS A LOT TODAY...              ##
        ########################################################################
        ## Play
        self._play_text = Text(FONT_NAME, FONT_MENU_SIZE,
                               -1, -1,
                               "Play", COLOR_BROWN);
        play_size = self._play_text.get_size();
        self._play_text.set_position(wcenter - (play_size[0] * 0.5), 300);

        ## Credits
        self._credits_text = Text(FONT_NAME, FONT_MENU_SIZE,
                                  -1, -1,
                                  "Credits", COLOR_BROWN);
        credits_size = self._credits_text.get_size();
        self._credits_text.set_position(wcenter - (credits_size[0] * 0.5), 360);

        ## AmazingCow
        self._amazingcow_text = Text(FONT_NAME, FONT_MENU_LOGO_SIZE,
                                     -1, -1, "amazingcow - 2016",
                                     COLOR_BROWN);
        amazing_size = self._amazingcow_text.get_size();
        self._amazingcow_text.set_position(wcenter - (amazing_size[0] * 0.5),
                                           GAME_WIN_HEIGHT - (amazing_size[1] + 10));

        ## Selection
        self._curr_selection = -1;
        self._update_selection(1, play_sound = False); ## Force the blinking on play...