| George 的个人资料George's XNA Programming日志列表网络 | 帮助 |
|
|
3月3日 XNA Slots - Part 1While looking at my blog's statistics, I noticed that I get many visitors searching for slot game implemented in XNA. I decided to dedicate a number of posts to building a simple slot game in Microsoft XNA. I will start from a very simple demo game and ultimately grow the project to a full-featured slot game. We will be developing a multi-line video slots game. More specifically, our slot game will have 5 columns and 3 visible lines as shown on the game screen-shot. In this type of slots, there are 9 playing lines and a user can choose which lines he/she wants to play. The heart of the game is a class, which I have named Reel. This class is in charge of rendering and animating the slot symbols on the screen.
Our reel will be using a virtual stop table. I will be describing the virtual table in an upcoming part but for now let's concentrate on the visual side of the game. Each symbol corresponds to a stop on the reel. Let's agree that we call Stop 1 such a position of the reel when the lowest symbol on a column is located at the bottom line.
You can download the source code and play with it. I have also put a compiled version for you to test. Run the application and hit the S key on the keyboard to spin. Our Reel class is extremely flexible. If you wanted to make a single line slots game, all you had to do is to change the REEL_LINES constant value from 3 to 1. In the next part we will add some labels on the screen so that we display different information (lines selected, balance, winnings) to the user. 评论 (1)引用通告 (8)此日志的引用通告 URL 是: http://xnadev.spaces.live.com/blog/cns!8B6E83562E8DE240!145.trak 引用此项的网络日志
|
|
|