<commit_before>#include "input.h"

void catch_signal(int signal)
{
    quit = 1;
}

void setup_input() {
    move_x = 0;
    move_y = 0;
}

void update_input()
{
    if (SDL_PollEvent(&event)) {
        switch(event.type) {
            case SDL_QUIT:
                quit = 1;
                break;
            case SDL_KEYDOWN:
                handle_keypress(event.key.keysym.sym);
                break;
            case SDL_KEYUP:
                handle_keyup(event.key.keysym.sym);
                break;
        }
    }

    ship_rect.x += move_x;
    ship_rect.y += move_y;
}

void handle_keypress(SDLKey key)
{
    switch(key) {
        case SDLK_ESCAPE:
            quit = 1;
            break;
        case SDLK_UP:
            move_y = -2;
            break;
        case SDLK_DOWN:<commit_msg>Changed references on input to ship movement.<commit_after>#include "input.h"

void catch_signal(int signal)
{
    quit = 1;
}

void setup_input() {
    move_x = 0;
    move_y = 0;
}

void update_input()
{
    if (SDL_PollEvent(&event)) {
        switch(event.type) {
            case SDL_QUIT:
                quit = 1;
                break;
            case SDL_KEYDOWN:
                handle_keypress(event.key.keysym.sym);
                break;
            case SDL_KEYUP:
                handle_keyup(event.key.keysym.sym);
                break;
        }
    }

    ship->rect.x += move_x;
    ship->rect.y += move_y;
}

void handle_keypress(SDLKey key)
{
    switch(key) {
        case SDLK_ESCAPE:
            quit = 1;
            break;
        case SDLK_UP:
            move_y = -2;
            break;
        case SDLK_DOWN:
{'fraction_non_alphanumeric': 0.10145808019441069, 'fraction_numerical': 0.007290400972053463, 'mean_word_length': 1.400874635568513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4684847', 'n_tokens_mistral': 583, 'n_tokens_neox': 542, 'n_words': 107}