简单游戏代码
Here are a few simple, working, games that you can use as-is or as the basis for your own games.
这里有一些简单,有效的游戏,您可以按原样使用或作为自己游戏的基础。
Tic-Tac-Toe 井字游戏This is one of the simplest of all games.
这是所有游戏中最简单的游戏之一。
Tic-Tac-Toe.zip Tic-Tac-Toe.zipThe game allows for a choice of who goes first and keeps track of the number of wins for each person. Here is a picture of the game in action.
游戏允许选择谁先行,并跟踪每个人的获胜次数。 这是游戏的画面。
Tic-Tac-Toe-VS-CPU.zip Tic-Tac-Toe-VS-CPU.zip Hangman man子手Hangman is also a simple game but depending on the word you need to solve, it can be challenging. The words used are in a file called SecretWords.txt and it's included in the zip file. You can of course add to or delete words in the list.
man子手也是一款简单的游戏,但是根据您需要解决的单词,它可能具有挑战性。 所使用的单词在一个名为SecretWords.txt的文件中,并且包含在zip文件中。 您当然可以在列表中添加或删除单词。
Hangman.zip Hangman.zipHere's a picture of the game in progress where the player is trying to solve the word 'elephant' and has incorrectly tried 'F'.
这是进行中的游戏的图片,其中玩家尝试解决“大象”一词并错误地尝试了“ F”。
Blackjack 二十一点The 3rd and last game is blackjack which you can download from
第三和最后一个游戏是二十一点,您可以从中下载
here. 在这里 。The programming for this game is more complex than the other two and here is what the game looks like.
该游戏的编程比其他两个程序更复杂,这就是游戏的外观。
The Options menu allows you to select the design for the back of the cards, the 'table' background color, the delay time between the dealing of each dealer's card, your starting bankroll, and the number of decks in play.
使用“选项”菜单,您可以选择纸牌背面的设计,“桌子”的背景颜色,每张发牌人的纸牌交易之间的延迟时间,起始资金以及游戏中的牌组数量。
Finally, the following is a very stripped down version of the blackjack game which demonstrates how to use the card deck.
最后,以下是二十一点游戏的精简版,演示了如何使用纸牌。
Card-Deck.zip Card-Deck.zipIt looks like this:
看起来像这样:
If you find that this article has been helpful, please click the “thumb’s up” button below. Doing so lets me know what is valuable for EE members and provides direction for future articles. It also provides me with positive feedback in the form of a few points. Thanks!
如果您发现本文对您有所帮助,请单击下面的“竖起大拇指”按钮。 这样做可以让我知道对EE成员有价值的内容,并为以后的文章提供指导。 它还以几点的形式为我提供了积极的反馈。 谢谢!
翻译自: https://www.experts-exchange/articles/9009/Simple-Games.html
简单游戏代码
更多推荐
简单游戏代码_简单游戏
发布评论