<commit_before># -*- coding: utf-8 -*-
"""
Runs interactive video game Swim Little Fish Swim

@author: <NAME>, <NAME>

last modified: 10-18-15
"""

import pygame
from pygame.locals import *
import sfcontroller
from sfcontroller import *
import sfmodel
from sfmodel import *
import sfview
from sfview import *
import random
import math
import time

            
if __name__ == '__main__':
    pygame.init()
    size = (640,480)
    screen = pygame.display.set_mode(size)
    sound = pygame.mixer.Sound("sounds/POL-coconut-land-short.wav")
    sound.play(loops = -1)
    sound.set_volume(0.4)

    model = SwimFishModel()
    view = SwimFishView(model, screen)
    controller = SwimFishMouseController(model, view)
    # controller = SwimFishKeyboardController(model)

    choices = ['images/octopus1_png.png','images/crab1.png']

    running = True
    playing = True
    eaten = False
    playAgain = False
    init = time.time()
    counter = 0
    view.init_screen()
    time.sleep(5)
    while running:
        while playing and not eaten:
            now = time.time()
            for event in pygame.event.get():
                if event.type == QUIT:
                    running = False
                elif event.type == KEYDOWN:
                    if event.key == K_ESCAPE:   #event is escape key
                        pygame.quit()
                elif event.type == MOUSEMOTION:
                    controller.handle_mouse_event(event)
                    # controller.handle_collision()
                # if event.type == KEYDOWN:
                #     controller.handle_key_event(event)
            for x in range(100,620,310):
                choice = choices[random.randint(0, 1)]
                monster = Monster(100, 100, choice, x, 120)
                model.monsters.append(monster)
            view.draw()
            
            if (controller.handle_collision()):
                eaten = True
                init = time.time()
            if (now-init >= 10):
                view.level_up()
                time.sleep(5)
                counter = 0
                init = time.time()
            time.sleep(0.01)

        while eaten:
            if (counter <= 3):
                view.eaten()
                eaten = False<commit_msg>monsters spawn, but aren't in the right places.<commit_after># -*- coding: utf-8 -*-
"""
Runs interactive video game Swim Little Fish Swim

@author: <NAME>, <NAME>

last modified: 10-18-15
"""

import pygame
from pygame.locals import *
import sfcontroller
from sfcontroller import *
import sfmodel
from sfmodel import *
import sfview
from sfview import *
import random
import math
import time

            
if __name__ == '__main__':
    pygame.init()
    size = (640,480)
    screen = pygame.display.set_mode(size)
    sound = pygame.mixer.Sound("sounds/POL-coconut-land-short.wav")
    sound.play(loops = -1)
    sound.set_volume(0.4)

    model = SwimFishModel()
    view = SwimFishView(model, screen)
    controller = SwimFishMouseController(model, view)
    # controller = SwimFishKeyboardController(model)

    choices = ['images/octopus1_png.png','images/crab1.png']

    running = True
    playing = True
    eaten = False
    playAgain = False
    init = time.time()
    last_monster_spawn = init
    counter = 0
    view.init_screen()
    time.sleep(5)
    while running:
        while playing and not eaten:
            now = time.time()
            for event in pygame.event.get():
                if event.type == QUIT:
                    running = False
                elif event.type == KEYDOWN:
                    if event.key == K_ESCAPE:   #event is escape key
                        pygame.quit()
                elif event.type == MOUSEMOTION:
                    controller.handle_mouse_event(event)
                    # controller.handle_collision()
                # if event.type == KEYDOWN:
                #     controller.handle_key_event(event)
            if now - last_monster_spawn >= 3:
                last_monster_spawn = last_monster_spawn + 3 
                for x in range(100,620,310):
                    choice = choices[random.randint(0, 1)]
                    monster = Monster(100, 100, choice, x, 120)
                    model.monsters.append(monster)
            view.draw()
            
            if (controller.handle_collision()):
                eaten = True
                init = time.time()
            if (now-init >= 10):
                view.level_up()
                time.sleep(5)
                counter = 0
                init = time.time()
            time.sleep(0.01)

        while eaten:
            if (counter <= 3):
                view.eaten()
                eaten = False
{'fraction_non_alphanumeric': 0.0992576882290562, 'fraction_numerical': 0.020784729586426298, 'mean_word_length': 1.665912945166761, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6511462', 'n_tokens_mistral': 1450, 'n_tokens_neox': 1329, 'n_words': 333}