Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
- switch(keyData){
- case Keys.Up:
- if (manY != 0){
- if (map[manX, manY - 1] != 0) {
- manY--;
- this.Refresh();
- }
- }
- break;
- case Keys.Left:
- if (manX != 0) {
- if (map[manX - 1, manY] != 0) {
- manX--;
- this.Refresh();
- }
- }
- break;
- case Keys.Down:
- if (manY != 7) {
- if (map[manX , manY + 1] != 0) {
- manY++;
- this.Refresh();
- }
- }
- break;
- case Keys.Right:
- if (manX != 7) {
- if (map[manX + 1, manY] != 0) {
- manX++;
- this.Refresh();
- }
- }
- break;
- }
- return base.ProcessCmdKey(ref msg, keyData);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement