# ==========================================
# DAMMAKU CATCH GAME - MAIN SYSTEM CODE
# ==========================================

background_x = 0
sprite1_x = 0
sprite1_y = -100
current_costume = "costume1"
is_draggable_all = False

def setup():
    global background_x, sprite1_x, sprite1_y, is_draggable_all
    sprite1_x = 0
    sprite1_y = -100
    background_x = 0
    is_draggable_all = True
    show_ui()
    move_ui_to_back()

def update_game_loop():
    global background_x
    sprite2_x = background_x
    if check_collision_with_sprite1():
        on_receive_move_right()
    elif check_collision_with_sprite3():
        on_receive_move_left()

def on_receive_move_right():
    global sprite1_x, background_x, current_costume
    current_costume = "costume1"
    if sprite1_x < 0:
        sprite1_x += 7
    else:
        if background_x == -385:
            if sprite1_x < 240:
                sprite1_x += 7
        else:
            background_x -= 7

def on_receive_move_left():
    global sprite1_x, background_x, current_costume
    current_costume = "costume2"
    if background_x == 385:
        if sprite1_x > 0:
            sprite1_x -= 7
    else:
        background_x += 7

def show_ui(): pass
def move_ui_to_back(): pass
def check_collision_with_sprite1(): return False
def check_collision_with_sprite3(): return False

