dimanche 19 avril 2015

I open ingame menu once and then my other keys not working

I am doing a Pong game. I made a panel which is ingame menu and set key C to open it.



if (e.KeyCode == Keys.Escape)
{
Application.Exit();
}

if (e.KeyCode == Keys.Space)
{
piłka.Top = 50;
piłka.Left = 50;
speed_left = 4;
speed_top = 4;
pkt = 0;
punkty_tb.Text = "0";
timer1.Enabled = true;
przegrana_tb.Visible = false;
}

if (e.KeyCode == Keys.C)
{
igmenu.Show();
Cursor.Show();
timer1.Enabled = false;
}


In this menu I have button Resume



private void playButton_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
igmenu.Hide();
Cursor.Hide();
}


When I resume my game, it works but the keys i set before are not working. I am begginer so I don't say my program is perfect. Thanks.


Aucun commentaire:

Enregistrer un commentaire