• Had
namespace Had
{
public enum Direction
{
Up,
Down,
Left,
Right
};
public class Settings
{
public static int Width { get; set; }
public static int Height { get; set; }
public static int Speed { get; set; }
public static int Score { get; set; }
public static int Points { get; set; }
public static bool GameOver { get; set; }
public static Direction direction { get; set; }
public Settings()
{
Width = 15;
Height = 15;
Speed = 15;
Score = 0;
Points = 100;
GameOver = false;
direction = Direction.Down;
}
}
}
• Inputusing System.Collections;
using System.Windows.Forms;
namespace Had
{
internal class Input
{
private static Hashtable keyTable = new Hashtable();
//verifikce zmacklého tlacitka
public static bool KeyPressed(Keys key)
{
if (keyTable[key] == null)
{
return false;
}
return (bool) keyTable[key];
}
//Verifikace jestli je zmacklé
public static void ChangeState(Keys key, bool state)
{
keyTable[key] = state;
}
}
}
