文件名称:C# Windows From 贪吃蛇
文件大小:3.15MB
文件格式:RAR
更新时间:2015-01-03 08:24:08
c# 贪吃蛇
键盘处理事件 private void PlayerFrom_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Left) snaker.SnakeWay = (this.snaker.SnakeWay == Way.right) ? Way.right : Way.left; else if (e.KeyCode == Keys.Right) snaker.SnakeWay = (this.snaker.SnakeWay == Way.left) ? Way.left : Way.right; else if (e.KeyCode == Keys.Up) snaker.SnakeWay = (this.snaker.SnakeWay == Way.down) ? Way.down : Way.up; else if (e.KeyCode == Keys.Down) snaker.SnakeWay = (this.snaker.SnakeWay == Way.up) ? Way.up : Way.down; else if (e.KeyCode == Keys.Space) { if (this.isStop) game.Resume(); else game.Suspend(); this.isStop = !this.isStop; } else e.Handled = true; }
【文件预览】:
贪吃蛇
----功能介绍.txt(92B)
----Snaker()
--------Snaker.suo(36KB)
--------Snaker.sln(860B)
--------Snaker()