星际战士(译文)
By robot-v1.0
本文链接 https://www.kyfws.com/games/star-fighter-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 3 分钟阅读 - 1108 个词 阅读量 0星际战士(译文)
原文地址:https://www.codeproject.com/Articles/5296/Star-Fighter
原文作者:Rikaino
译文由本站 robot-v1.0 翻译
前言
A quick and dirty example to make a Star Fighter game using forms with C#
使用C#表单制作Star Fighter游戏的简单又肮脏的示例
介绍(Introduction)
确实没有太多使用C#语言编写的游戏编程示例…尚未.来自游戏编程的背景,我决定使用Visual Studio .NET.经过2小时的编码后的最终结果:(There aren’t really too many game programming examples with the C# language…not yet. Coming from a game programming background, I decided to whip one up with Visual Studio .NET. The final result after 2 hours of coding:)星球大战1.0(Star Fighter 1.0).(.)
方法(Method)
我决定不使用DirectX界面,而是决定使用简单的Windows窗体.这个过程很简单.整个游戏循环由一个简单的计时器事件处理,该事件处理船的运动,外星人的运动,炸弹和子弹.键盘输入由keydown处理程序事件完成.整个代码是不言自明的并且有据可查.图形从Blitz3d的演示游戏" Insectoids"中删除.(Instead of digging deep into the DirectX interface, I decided to just use simple Windows Forms. The process is quite simple. The entire game loop is handled by a simple form timer event which processes the ship movement, aliens movement, bombs, and bullets. Keyboard input is done by the keydown handler event. The entire code is self explanatory and fairly documented. Graphics were ripped from Blitz3d’s demo game “Insectoids”.)
虫子(Bugs)
只是警告大家,Windows窗体是(Just a warning to everyone, Windows Forms is)不(not)这是制作激烈动作图形的最佳方法,如果您遇到一些性能不佳和速度变慢的情况,那是正常的.我使用P4 3.02 ghz运行了这段代码,它对我来说很顺利,但是其他人报告说速度非常慢.此外,当飞船被外星人的炸弹击中时,还会有一个令人讨厌的错误,导致游戏结束-经过半小时的调试,我无法弄清楚.(the best method for intense action graphics, and if you experience some poor performance and slowdowns, it’s normal. I ran this code using a P4 3.02 ghz and it went smoothly for me but others reported extreme slowness. Also, there’s an annoying bug when the ship gets hit by the alien’s bomb which causes the game to end - that which I could not figure out after a half an hour of debugging.)
问题,评论,投诉(Questions, Comments, Complaints)
有关更多项目,游戏演示,C#编程,请访问我的网站:(For more projects, game demos, C# programming visit my website:) http://www.3d-design.0catch.com/(http://www.3d-design.0catch.com/) .(.) 玩得开心!(Have fun!)
历史(History)
- 26(26)日(th)2003年10月:初始版本(October, 2003: Initial version)
执照(License)
本文没有附带任何明确的许可,但可能在文章文本或下载文件本身中包含使用条款.如有疑问,请通过下面的讨论区与作者联系.(This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.) 可以找到作者可能使用的许可证列表(A list of licenses authors might use can be found) 这里(here) .(.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C# C++ .NET1.1 Win2K WinXP Win2003 .NET1.0 MFC Visual-Studio Dev 新闻 翻译