// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import Snake from "../../GamePlay/Snake";
import UIManager from "../UIManager";
import ScreenUI, { ScreenName } from "./ScreenUI";

const { ccclass, property } = cc._decorator;

@ccclass
export default class InGameScreen extends ScreenUI {

    @property(Snake)
    sake: Snake = null;

    override initialize(uiManager: UIManager): void {
        super.initialize(uiManager);
        this.screenName = ScreenName.INGAME;
    }

    onButtonUp() {
        this.sake.moveUp();
    }

    onButtonDown() {
        this.sake.moveDown();
    }

    onButtonLeft() {
        this.sake.moveLeft();
    }

    onButtonRight() {
        this.sake.moveRight();
    }

    override active(): void {
        super.active();
    }

    override deactive(): void {
        super.deactive();
    }



}
