学习用C++开发你的第一个游戏
试试用C++开发个游戏玩玩。
ALZ-one
这个作者很懒,什么都没留下…
展开
-
40 Win Or Lose Screen
// Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。///*This is the console executable, that makes use of the BullCow classThis acts as the view in a MVC pattern, and is responsible for alluser interaction. For game logic see the FBullCow class.*/# include.原创 2020-06-20 16:02:50 · 137 阅读 · 0 评论 -
39 Handling Game Win Condition
// Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。///*This is the console executable, that makes use of the BullCow classThis acts as the view in a MVC pattern, and is responsible for alluser interaction. For game logic see the FBullCow class.*/# include.原创 2020-06-20 15:43:01 · 119 阅读 · 0 评论 -
38 Warm Fuzzy Feelings
// Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。///*This is the console executable, that makes use of the BullCow classThis acts as the view in a MVC pattern, and is responsible for alluser interaction. For game logic see the FBullCow class.*/# include.原创 2020-06-20 15:26:44 · 144 阅读 · 0 评论 -
37 Using switch Statements
学习用C++开发你的第一个游戏(英文) // Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。///*This is the console executable, that makes use of the BullCow classThis acts as the view in a MVC pattern, and is responsi...原创 2020-06-15 22:42:07 · 98 阅读 · 0 评论 -
36 Writing Error Checking Code
学习用C++开发你的第一个游戏(英文) // Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。///*This is the console executable, that makes use of the BullCow classThis acts as the view in a MVC pattern, and is responsi...原创 2020-06-15 17:29:46 · 128 阅读 · 0 评论 -
35 Introducing enumerations
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>using FString = std::string;using int32 = int;// all values intialised to zerostruct FBullCowCount{ int32 Bulls...原创 2020-06-12 17:19:54 · 101 阅读 · 0 评论 -
34 A Place for Everything
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>using FString = std::string;using int32 = int;// all values intialised to zerostruct FBullCowCount{ int32 Bulls...原创 2020-06-12 16:30:41 · 141 阅读 · 0 评论 -
33 Debugging 101
学习用C++开发你的第一个游戏(英文) // FBullCowGame.cpp#include "FBullCowGame.h"using int32 = int;void FBullCowGame::Reset(){ constexpr int32 MAX_TRIES = 8; MyCurrentTry = 1; MyMaxTries = MAX_TRIES; c...原创 2020-06-11 11:27:27 · 71 阅读 · 0 评论 -
32 Using if Statements in C++
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>using FString = std::string;using int32 = int;// all values intialised to zerostruct FBullCowCount{ int32 Bulls...原创 2020-06-11 11:08:14 · 102 阅读 · 0 评论 -
31 Using struct for Simple Types
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>using FString = std::string;using int32 = int;// all values intialised to zerostruct BullCowCount{ int32 Bulls =...原创 2020-06-11 10:39:57 · 75 阅读 · 0 评论 -
30 Using using for Type Aliases
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>using FString = std::string;using int32 = int;class FBullCowGame {public: FBullCowGame(); // constructor int3...原创 2020-06-10 16:58:44 · 76 阅读 · 0 评论 -
29 Pseudocode Programming
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>class FBullCowGame {public: FBullCowGame(); // constructor int GetMaxTries() const; int GetCurrentTry() const; ...原创 2020-06-10 16:22:40 · 136 阅读 · 0 评论 -
28 Constructors For Initialisation
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>class FBullCowGame {public: FBullCowGame(); // constructor int GetMaxTries() const; int GetCurrentTry() const; ...原创 2020-06-10 15:48:24 · 92 阅读 · 0 评论 -
27 Introducing the Const Keyword
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>class FBullCOwGame {public: int GetMaxTries() const; int GetCurrentTry() const; bool IsGameWon() const; void R...原创 2020-06-10 15:14:01 · 192 阅读 · 0 评论 -
26 Writing & Using Getter Methods
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma once# include <string>class FBullCOwGame {public: void Reset(); //ToDo make a more rich return value. int GetMaxTries(); int GetCurrentT...原创 2020-06-10 14:42:52 · 91 阅读 · 0 评论 -
25 Instantiating Your Class
undefined // CowBull.cpp重命名为Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。//# include <iostream># include <string> // 引入string 库# include "FBullCowGame.h"void PrintIntro();vo...原创 2020-06-10 14:14:29 · 89 阅读 · 0 评论 -
24 Including Our Own Header File
学习用C++开发你的第一个游戏(英文) // CowBull.cpp重命名为Main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。//# include <iostream># include <string> // 引入string 库void PrintIntro();void PlayGame();st...原创 2020-06-10 11:34:42 · 94 阅读 · 0 评论 -
23 using Header Files as Contracts
学习用C++开发你的第一个游戏(英文) // FBullCowGame.h#pragma onceclass FBullCOwGame {public: void Reset(); //ToDo make a more rich return value. int GetMaxTries(); int GetCurrentTry; bool IsGameWon();...原创 2020-06-10 11:06:02 · 75 阅读 · 0 评论 -
21 using do and while in C++
学习用C++开发你的第一个游戏(英文) # include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了void PrintIntro();void PlayGame();s...原创 2020-06-09 17:36:14 · 79 阅读 · 0 评论 -
20 booleans and comparisons
学习用C++开发你的第一个游戏(英文) # include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了void PrintIntro();void PlayGame();s...原创 2020-06-09 17:15:51 · 116 阅读 · 0 评论 -
19 Clarity is Worth Fighting For
学习用C++开发你的第一个游戏(英文) # include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了void PrintIntro();void PlayGame();st...原创 2020-06-09 12:27:31 · 88 阅读 · 0 评论 -
18 Iterating With For & While Loops
学习用C++开发你的第一个游戏(英文) # include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了void PrintIntro(); string GetGuessAn...原创 2020-06-08 18:52:20 · 83 阅读 · 0 评论 -
17 simplifying with functions
学习用C++开发你的第一个游戏(英文) # include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了void PrintIntro(); string GetGuessAn...原创 2020-06-08 18:24:23 · 108 阅读 · 0 评论 -
16 Using getline()
# include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了int main(){ // 介绍游戏 constexpr int WORLD_LENGTH = 5; // 定义一个变量让单词的长度可变 cout << "Welocm to Bulls and Co..原创 2020-06-08 17:43:34 · 78 阅读 · 0 评论 -
15 Variables and cin for input
学习用C++开发你的第一个游戏(英文) # include <iostream># include <string> // 引入string 库using namespace std; // 引入命名空间std,之后的cout 和 endl 就不用再加上std:: 了int main(){ // 介绍游戏 constexpr i...原创 2020-06-08 10:49:14 · 98 阅读 · 0 评论 -
14 Magic Numbers and Constants
学习用C++开发你的第一个游戏(英文) # include <iostream>using namespace std; // 命名空间std,之后的cout 和 endl 就不用再加上std:: 了int main(){ cout << "Welocm to Bulls and Cows, a fun word game." << en...原创 2020-06-08 10:32:05 · 100 阅读 · 0 评论 -
13 # include and Namespaces
# include <iostream>int main(){ std::cout << "Welcom to Bulls and Cows\n"; std::cout << "Welocm to Bulls and Cows" << std::endl; // 推荐 return 0;}升级# include <iostream>using namespace std; // 命名空间std,之后的cou.原创 2020-06-08 10:19:24 · 103 阅读 · 0 评论 -
12 C++ Function Syntax
// C++ 中函数的语法<返回值类型>_<返回值名称> (<参数>){ <要实现的语句>}int main(){ return 0;}运行结果:原创 2020-06-08 09:53:45 · 124 阅读 · 0 评论 -
11How Solutions & Projects Relate
原创 2020-06-07 20:21:24 · 84 阅读 · 0 评论 -
10 Game Design Document
学习用C++开发你的第一个游戏(英文)原创 2020-06-07 19:02:38 · 266 阅读 · 0 评论