﻿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 GorDol
{
    public partial class GorDol : Form
    {
        int PREMIK = -1;
        public GorDol()
        {
            InitializeComponent();
            timer1.Start();
        }

         private void premik(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Up)
            {
                ptic.Top -= 2;
            }
            if (e.KeyCode == Keys.Down)
            {
                ptic.Top += 2;
            }
            if (e.KeyCode == Keys.Space)
            {
                PREMIK = 1;
            }
        }

        private void spust(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space)
            {
                PREMIK = -1;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            pisek.Top += PREMIK;
        }
    }
}
