George 的个人资料George's XNA Programming日志列表网络 工具 帮助

日志


3月5日

XNA Slots - Part 2

Here comes an updated version of XNASlots.

As you can see from the screen-shot, the game now displays stake, winning and balance information.

It is now possible to specify stake and selected lines and when the slot is spun, correct amount is deducted from the user balance.

You can hit 1, 3, 5, 7, 9 keys on the keyboard to select lines and the Spacebar is used to increase bet.

Maximum bet is $10. This is defined in a new constant named MAX_STAKE.

I use Nuclex fonts to display texts in the game. You can find more information about Nuclex fonts in one of my previous posts.

There are a couple of cosmetic changes to the code. For example, the keyboard input is moved to a new method UpdateInput.

We now deduct user balance after each spin and the Spin method has been amended to reflect this as well.

SelectLines and IncreaseStake are two new functions. As you may guess from the names, the former method select lines and the later increases user stake.

The Draw method has been updated to draw texts on the screen.

The LoadGraphicsContent has been changed to load a font.

The background image has been changed as well. I decided to put the stake, winning, balance panel on the main background.

In the next part, we will add the winning table and more cool stuff.

Download the Source Code

Download Compiled Version

评论 (3)

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

David发表:
source can't download. :( Can you send me files to mail or rapir link place
10 月 29 日
没有名字发表:
source does not run on my new laptop:
 
System.ArgumentException was unhandled
  Message="Device does not support multi-level texture width and height values that are not powers of 2.\r\nParameter name: numberLevels"
  Source="Microsoft.Xna.Framework"
  ParamName="numberLevels"
 

reelsTexture = content.Load<Texture2D>(@"Assets/Textures/reelstexture");

 

11 月 3 日
Please contact me, I work for a software company looking for XNA developers, we need your help :-)
3 月 27 日

引用通告

此日志的引用通告 URL 是:
http://xnadev.spaces.live.com/blog/cns!8B6E83562E8DE240!148.trak
引用此项的网络日志