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

Time for action – play SquareChase!

  1. Run your game by clicking on Start Debugging from the Debug menu or hitting 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 around 30 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).
主站蜘蛛池模板: 连山| 濮阳市| 嘉祥县| 辽源市| 泸州市| 山东省| 攀枝花市| 昭苏县| 小金县| 锡林郭勒盟| 高陵县| 阿克陶县| 海安县| 玛多县| 绥德县| 益阳市| 茶陵县| 怀安县| 宁德市| 大安市| 定襄县| 赤水市| 屏山县| 德江县| 女性| 微博| 文登市| 枣强县| 纳雍县| 景泰县| 普兰县| 白玉县| 嘉祥县| 铅山县| 临城县| 甘肃省| 奉新县| 宁明县| 北安市| 民丰县| 老河口市|