﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Flappy
{
    public partial class Flappy : Form
    {
        const int ENOTAGORDOL = 15;
        int premik = ENOTAGORDOL;

        public Flappy()
        {
            InitializeComponent();
        }

        private void pritiskTipke(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space)
            { premik = -ENOTAGORDOL; }
        }

        private void spustTipke(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space)
            { premik = ENOTAGORDOL; }
        }

        private void izvediPremike(object sender, EventArgs e)
        {
            ptic.Top += premik;
        }

        private void zacetek_Click(object sender, EventArgs e)
        {
            timer1.Start();
            this.Controls.Remove((Button)sender);
        }
    }
}
