官术网_书友最值得收藏!

Time for action – play SquareChase!

  1. Run your game by clicking on Start Debugging from the Debug menu or hit F5 on the keyboard.
  2. Play an exciting game of SquareChase by holding down the mouse button and trying to catch the squares with your mouse cursor:
    Time for action – play SquareChase!

What just happened?

You just finished your first XNA game, that's what!

Granted it is not exactly the next blockbuster, but at only 33 lines of code, it implements a simple game mechanic, user input, score tracking and display, and clock-based timing. Not bad for a few minutes work.

Have a go hero

As simple as it is, here are a couple of enhancements you could make to SquareChase:

  • Vary the size of the square, making it smaller every few times the player catches one, until you reach a size of 10 pixels.
  • Start off with a higher setting for TimePerSquare and decrease it a little each time the player catches a square. (Hint: You'll need to remove the const declaration in front of TimePerSquare if you wish to change it at runtime).
主站蜘蛛池模板: 故城县| 朝阳县| 房产| 客服| 宁化县| 江北区| 花莲县| 宁陕县| 福州市| 湘潭县| 乐平市| 介休市| 自治县| 霍邱县| 时尚| 靖安县| 江门市| 嘉定区| 普安县| 邯郸县| 宜兰县| 闽侯县| 津市市| 隆林| 龙岩市| 九龙县| 霍州市| 来宾市| 三河市| 天津市| 钟祥市| 罗甸县| 隆化县| 阜南县| 理塘县| 小金县| 潞西市| 德格县| 大渡口区| 错那县| 长寿区|