星际迷航银河(译文)
By robot-v1.0
本文链接 https://www.kyfws.com/games/startrek-galaxy-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 6 分钟阅读 - 2720 个词 阅读量 0星际迷航银河(译文)
原文地址:https://www.codeproject.com/Articles/28911/StarTrek-Galaxy
原文作者:rehopkins
译文由本站 robot-v1.0 翻译
前言
Windows Multiple ship version of the classic StarTrek
经典StarTrek的Windows Multiple发行版
- 下载GalaxyCode-1.03 MB(Download GalaxyCode - 1.03 MB)
- 下载GalaxySetup-3.38 MB(Download GalaxySetup - 3.38 MB)
介绍(Introduction)
早在1970年代初,我第一次在Univac大型机上遇到StarTrek.当时,它是用Univac 1100 Basic编写的,官方代码标签为"(It was back in the early 1970s when I first encountered StarTrek on a Univac mainframe computer. At that time, it was written in Univac 1100 Basic and had the official code label of ‘)STTR2.BAS(STTR2.BAS)’. (('. ()**STTR1.BAS(STTR1.BAS)**就是说明).请参阅Michael Birken在" Star Trek 1971 Text Game"上的文章.如果我没记错的话,所有命令和概念都相同. Univac'(was the instructions) See the Michael Birken article on “Star Trek 1971 Text Game.” All the commands and concepts are the same, if I recall correctly. The Univac ‘) STTR2
游戏使我开始编程.我只需要了解它是如何工作的!结果,我从其他系统中收集了大约十二种该游戏的变体,并将其转换为Univac Basic.后来,它与我拥有的StarTrek的经典版本一起被转换为处理器技术SOL-20 BASIC5和Extended Basic.此最终版本在Visual Basic 5中,并且模仿较旧计算机版本的"滚动文本"屏幕.一个很大的不同是稍后显示的Windows GUI按钮界面.(’ game launched me into programming. I just had to understand how it worked! As a result, I collected about a dozen varieties of this game from various other systems and converted them to Univac Basic. Later, it was converted to Processor Technology SOL-20 BASIC5 and Extended Basic along with the classic versions of StarTrek that I had. This final version is in Visual Basic 5 and mimics the ‘rolling text’ screen of the older computer versions. One big difference is the Windows GUI push-button interface shown later.)
提交此文件的原因之一是,如果我不这样做,它可能会永远丢失.(One reason to submit this is that if I don’t, it may be lost forever.)
背景(Background)
现在简而言之,我从头开始编写此版本,并将" Universe"扩展到10x10网格系统,并添加了其他星际飞船和"敌人".然后,几艘船将对"星系"或"宇宙"的整体扫描做出贡献.由于这是一个非常不同的版本,因此我将其命名为GALAXY,却不知道其他"同名"程序.在由于移动或"转弯"命令而失去转弯之前,每艘船都可以扫描,射击或执行其他命令.然后,克林贡人和隐身的罗慕兰人将移动!一旦知道了星空基地在哪里,就可以在这里"停靠",然后等待敌人接近你.反物质炸弹炸毁了星星和附近的所有敌人.反物质探针炸毁了相邻象限中的星星以及敌人.侦察探针将显示其经过的所有象限的"扫描".这对于在敌人的动作重置扫描之前快速找到"星际基地"非常重要.找到"星际基地"后,请注意其坐标,因为任何其他星际飞船都可以对该星际基地进行点对点扭曲.(Now to make a long story short, I wrote this version from the ground up and expanded the ‘Universe’ to a 10x10 grid system and added other starships and ‘enemies.’ Several ships would then contribute to the overall scan of the ‘galaxy’ or ‘universe.’ Since this was so different a version, I named it GALAXY and was not aware of other programs ‘out there’ by the same name. Each ship could scan, shoot or do other commands before losing its turn due to a move or a ‘pass turn’ command. And then the Klingons and cloaked Romulans would move! Once you knew where a Star Base was, you could ‘dock’ there and just wait for the enemies to approach you. Anti-matter bombs blew up stars and any nearby enemies. Anti-Matter Probes blew up stars in the adjoining quadrant along with the enemies. A Scout-Probe would show the ‘scan’ of all quadrants it traveled through. This was important to quickly find Star Bases before enemy movements could reset the scan. Once you find a Star Base, note its co-ordinates as any other starship can do a point-to-point warp to that base.)
代码样例(Code Sample)
这只是一个"子例程",它说明了一些到Visual Basic的转换.这是一个代码块,可能很容易理解,而无需编写一本书来描述其工作原理.由于许多变量是从原始代码中"按原样"提出的,因此,如果在VB.NET转换中将其重构,则这些变量不会自动记录.(This is just one ‘subroutine’ to illustrate some of the conversion to Visual Basic. This is one code block that may be simple enough to understand without writing a book to describe how it works. Since many of the variables were lifted ‘as is’ from the original code, the variables are NOT self-documenting as they could be if this were re-factored in a VB.NET conversion.)
Public Function fxDecodeSymbol(sSymbol As String) As Integer
' #########################################################
' ##
' ## Sub fxDecodeSymbol(...)
' ##
' ## Purpose: Decode a Symbol to a Type #
' ##
' ## Parameters:
' ## iShip = Ship calling this Sub
' ##
' ## Author: Ralph Hopkins
' ## Date: August 3, 2000
' ## Update:
' ## Revisions: 1.0.0 Initial Version **/**/2000
' ##
' #########################################################
Dim iShipType As Integer
iShipType = -1
Select Case sSymbol
Case sS1$: ' Star
Case "<E>": iShipType = SC_ENTERPRISE
Case ":E:": iShipType = SC_E_SHUTTLE
Case "<L>": iShipType = SC_LEXINGTON
Case ":L:": iShipType = SC_L_SHUTTLE
Case "<R>": iShipType = SC_REPUBLIC
Case ":R:": iShipType = SC_R_SHUTTLE
Case "<I>": iShipType = SC_INTERPRID
Case ":I:": iShipType = SC_I_SHUTTLE
Case "<H>": iShipType = SC_HOOD
Case ":H:": iShipType = SC_H_SHUTTLE
Case sB$: iShipType = SC_BASE1
Case sK$: iShipType = SC_KL_WARSHIP ' Klingon
Case sJ$: iShipType = SC_KL_CRUISER ' Super Klingon
Case sR$: iShipType = SC_ROMULAN ' Romulan
Case sZ$: iShipType = SC_ZORPH ' Zorph
Case sG$: iShipType = SC_GORN ' Gorn
Case sG1$: iShipType = SC_GORN_SCOUT ' Gorn Scout
Case sG2$: iShipType = SC_GORN_BASE ' Gorn Base
Case sX$: iShipType = SC_XEONITE ' Xeonite
Case sH$: iShipType = SC_BLACK_HOLE ' Black Hole
Case sD$: ' Destroyed Ship
Case sD1$: ' Destroyed Star
Case sN$: iShipType = SC_TRITON_MINE ' Triton Mine
End Select
fxDecodeSymbol = iShipType
End Function ' End fxDecodeSymbol(...)
使用程序(Using the Program)
第一个图形是启动屏幕,显示一些界面以及"标题"块中的"敌人"符号.该屏幕显示了对克林贡语(2(The first graphic is the start-up screen to show some of the interface as well as the ‘enemy’ symbols in the ‘header’ block. This screen shows a short-range scan of the Klingons (2)nd(nd)按钮).(button on left panel).)
这个按钮(This button)
和旧照片一样(is the same as the old PHOTONS ‘) 4
命令.另外,请注意,我们可以"自动开火",这意味着计算机可以为我们进行计算和射击!(’ command. Also, note that we can ‘Auto-Fire’ which means that the computer does the calculations and shooting for us!)
结果,我们采取了一些回击行动,并将不得不再次射击.(As a result, we take some return fire and will have to shoot again.)
之后,我们可以单击远程扫描按钮.(After that, we can click the Long Range scan button.)
然后,在检查我们的状态之后,计算机的第一个按钮将显示共享地图.(Then after checking our status, the computer’s first button brings up the shared map.)
这是游戏的快速示例.有一个包含更多信息的帮助文件.(This is a quick sample of the game. There is a HELP file with more information.)
兴趣点(Points of Interest)
源中包含了较旧的原始代码(在Basic中).那里也有说明显示您可能拥有"拖拉机束"来捕捉弱小外星人.如果我记得的话,您可能可以捕获Romulan隐藏装置.每艘船都可以发射一枚带有反物质炸弹的航天飞机.它可以充当"侦察兵"并消灭敌人.它在"宇宙"地图上显示为另一艘船.因此,您最多只能拥有5艘船.您最多可以有5个Shuttle-craft参与游戏.当他们迷路了,他们走了!(Older original code (in Basic) is included with the source. There are instructions there also that reveal that you may have a ‘Tractor Beam’ to capture weak aliens. If I recall, you may be able to capture a Romulan Cloaking device. Each ship can launch one Shuttle-craft with an Anti-Matter bomb. It can act as a ‘Scout’ and maybe destroy an enemy. It appears as another ship on the ‘universe’ map. That is why you can only have up to 5 ships. You have up to 5 Shuttle-craft to potentially be active in the game. When they are lost, they are gone!)
历史(History)
- 28(28)日(th)2008年8月:初始版本(August, 2008: Initial version)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VB Windows Dev 新闻 翻译