`
lindexi-gd
  • 浏览: 130842 次
社区版块
存档分类
最新评论

WPF游戏,使用move游戏开发

 
阅读更多

我看了好多游戏的源码,其实每一个,我想做,rpg的都需要移动,那么wpf,win8应用,数据绑定,我们需要一个Thread来让人物移动。
于是用move。
在每个人物,自己和敌人,npc类,都有一个move。
在C#,一个最底类,people,有抽象函数move,属性将要走x,将要走y。
然后在需要人物移动。
DispatcherTimer GameMianTimer;
GameMianTimer = new DispatcherTimer();
GameMianTimer.Interval = TimeSpan.FromSeconds(0.09);
//到达时间后执行GameMianTimer_Tick事件
GameMianTimer.Tick += GameMianTimer_Tick;
GameMianTimer.Start();

在GameMianTimer_Tick使用move。
所有人和怪物都在列表,foreach就把他们move。
一旦人物死,就remove。

<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('<li/>').text(i)); }; $numbering.fadeIn(1700); }); }); </script>

版权声明:本文为博主原创文章,未经博主允许不得转载。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics