<commit_before>import * as Phaser from 'phaser';
import {LevelsManager} from '../levels/levels-manager';
import {GameState} from '../states/game';

export class FinishZone extends Phaser.Sprite {
    constructor(game: Phaser.Game, x: number, y: number) {
        super(game, x, y, 'finish-zone');
        this.game = game;
        this.anchor.setTo(0.5);
    }

    setupBody() {
        this.getP2Body().static = true;
        this.getP2Body().setCircle(50);
        this.body.onBeginContact.add(this.handleContact, this.game.state);
    }

    getP2Body() : Phaser.Physics.P2.Body {
        return this.body;
    }

    handleContact(body) {
        console.log('FinishZone - handleContact');
        if (body.sprite.key === 'boat-paper') {
            let state = this.game.state.states.Game as GameState;
            state.levelsManager.goToNext();
        }
    }

}<commit_msg>Smaller polygon for finis-zone<commit_after>import * as Phaser from 'phaser';
import {LevelsManager} from '../levels/levels-manager';
import {GameState} from '../states/game';

export class FinishZone extends Phaser.Sprite {
    constructor(game: Phaser.Game, x: number, y: number) {
        super(game, x, y, 'finish-zone');
        this.game = game;
        this.anchor.setTo(0.5);
    }

    setupBody() {
        this.getP2Body().static = true;
        this.getP2Body().setCircle(40);
        this.body.onBeginContact.add(this.handleContact, this.game.state);
    }

    getP2Body() : Phaser.Physics.P2.Body {
        return this.body;
    }

    handleContact(body) {
        console.log('FinishZone - handleContact');
        if (body.sprite.key === 'boat-paper') {
            let state = this.game.state.states.Game as GameState;
            state.levelsManager.goToNext();
        }
    }

}
{'fraction_non_alphanumeric': 0.1441390914189568, 'fraction_numerical': 0.0089736399326977, 'mean_word_length': 2.49119373776908, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5192269', 'n_tokens_mistral': 589, 'n_tokens_neox': 570, 'n_words': 109}