首页下载资源后端一个免费的c++小游戏集合

RAR一个免费的c++小游戏集合

cmh201201021.13MB需要积分:1

资源文件列表:

c++.rar 大约有118个文件
  1. c++\ABS五子棋(win10).cpp 2.24KB
  2. c++\ABS五子棋(win7).cpp 2.17KB
  3. c++\Beat BIT.cpp 11.8KB
  4. c++\flappy_bird1(比2更精致,但有闪屏问题).cpp 1.56KB
  5. c++\gmon.out 207B
  6. c++\move闯关.cpp 3.61KB
  7. c++\qwq.cpp 8.44KB
  8. c++\UNO.cpp 1.78KB
  9. c++\yourcraft.cpp 2.4KB
  10. c++\三国杀AI(偶尔有BUG).cpp 8.01KB
  11. c++\三子棋.cpp 3.79KB
  12. c++\丧尸危机.cpp 14.72KB
  13. c++\中国象棋.cpp 1.91KB
  14. c++\为民除害.cpp 5.34KB
  15. c++\二号餐馆.cpp 1.84KB
  16. c++\五子棋.cpp 1.08KB
  17. c++\五子棋2.cpp 1.99KB
  18. c++\五子棋AI对战.cpp 1.4KB
  19. c++\仿generals.cpp 4.06KB
  20. c++\仿猫国建设者.cpp 4.15KB
  21. c++\俄罗斯方块.cpp 1.42KB
  22. c++\俄罗斯方块1(上下左右控制).cpp 2.65KB
  23. c++\俄罗斯方块2(J,L左移右移;D变换方向).cpp 4.53KB
  24. c++\俄罗斯方块3(下落有BUG,不会死).cpp 2.51KB
  25. c++\元气世界.cpp 2.39KB
  26. c++\全民枪王.cpp 6.28KB
  27. c++\冒险者传说(失落之城续).cpp 8.01KB
  28. c++\创意棋类游戏.cpp 6.33KB
  29. c++\勇士之战.cpp 29.35KB
  30. c++\勇者与魔王.cpp 6.27KB
  31. c++\双人围棋.cpp 1023B
  32. c++\双人坦克.cpp 7.57KB
  33. c++\双人对打(键位奇怪).cpp 5.53KB
  34. c++\双人技能大作战.cpp 5.27KB
  35. c++\双人枪战.cpp 2.27KB
  36. c++\双人格斗(人机).cpp 1.5KB
  37. c++\变色小跳龙.cpp 1.58KB
  38. c++\吃豆人.cpp 2.78KB
  39. c++\哈利波特.cpp 16.74KB
  40. c++\国粹麻将.cpp 11.29KB
  41. c++\城堡.cpp 5.2KB
  42. c++\多彩逗比.cpp 4.29KB
  43. c++\大乱斗.cpp 5.11KB
  44. c++\大富翁竞技场.cpp 6.25KB
  45. c++\失落之城.cpp 4.61KB
  46. c++\如果你被困在3月18日.cpp 4.32KB
  47. c++\如果你被困在3月18日.exe 557.88KB
  48. c++\子弹打飞机.cpp 3.43KB
  49. c++\小跳蛙.cpp 5KB
  50. c++\小鸟快飞flappy_bird2.cpp 1.45KB
  51. c++\弹球.cpp 1.79KB
  52. c++\忍者必须死.cpp 9.97KB
  53. c++\怪兽纪元.cpp 5.21KB
  54. c++\我的世界战争.cpp 4.09KB
  55. c++\战争.cpp 2.5KB
  56. c++\战意怒吼.cpp 4.21KB
  57. c++\战火英雄.cpp 2.48KB
  58. c++\打怪升天小游戏.cpp 1.92KB
  59. c++\打怪小游戏.cpp 1.89KB
  60. c++\打方块.cpp 1.91KB
  61. c++\打败胎神.cpp 2.05KB
  62. c++\打飞机加强版.cpp 3.54KB
  63. c++\扫雷.cpp 3.63KB
  64. c++\技能大乱斗-壮志凌云.cpp 10.35KB
  65. c++\拯救公主.cpp 5.12KB
  66. c++\掘地矿胎.cpp 3.63KB
  67. c++\探险故事.cpp 3.19KB
  68. c++\推箱子1.cpp 1.35KB
  69. c++\推箱子2.cpp 1.83KB
  70. c++\推箱子3(好评).cpp 1.93KB
  71. c++\数字华容道.cpp 820B
  72. c++\文明模拟器.cpp 2.12KB
  73. c++\斗地主.cpp 4.35KB
  74. c++\斗破苍穹.cpp 6.64KB
  75. c++\易帆小游戏.cpp 4.29KB
  76. c++\暗黑诅咒(第一季).cpp 24.25KB
  77. c++\暗黑诅咒(第二季).cpp 5.2KB
  78. c++\枪战(人机).cpp 5.5KB
  79. c++\歹徒逃亡1.cpp 8.9KB
  80. c++\歹徒逃亡2.cpp 6.51KB
  81. c++\歹徒逃亡3.cpp 10.65KB
  82. c++\海战棋.cpp 2.66KB
  83. c++\海盗战争.cpp 8.17KB
  84. c++\牛顿的跳跃?评测器大战.cpp 4.56KB
  85. c++\狼人杀.cpp 8.08KB
  86. c++\狼人杀1.cpp 5.3KB
  87. c++\狼人杀(人机).cpp 1.68KB
  88. c++\猜单词(弱化版).cpp 822B
  89. c++\猜数字(单人或多人).cpp 1.91KB
  90. c++\王奴.cpp 9.09KB
  91. c++\球球大作战.cpp 1001B
  92. c++\生化危机.cpp 26.7KB
  93. c++\生死枪战(无限关卡).cpp 2.29KB
  94. c++\砸电脑(无聊小游戏).cpp 1.26KB
  95. c++\神域.cpp 4.92KB
  96. c++\秘境.cpp 5.7KB
  97. c++\经典坦克大战.cpp 13.21KB
  98. c++\股票游戏.cpp 3.4KB
  99. c++\胎神之路(弹跳游戏).cpp 4.17KB
  100. c++\胎红胎蓝(单人或双人).cpp 4.23KB
  101. c++\草原战争(单人).cpp 2.65KB
  102. c++\草原战争(双人).cpp 2.49KB
  103. c++\解除关机代码.cpp 104B
  104. c++\贪吃蛇.cpp 3.61KB
  105. c++\贪吃蛇无限版.cpp 2.62KB
  106. c++\贪吃蛇经典版(有墙壁).cpp 1.85KB
  107. c++\超级按钮.cpp 1.52KB
  108. c++\跑酷游戏.cpp 6.4KB
  109. c++\连连看(有点难操作).cpp 2.51KB
  110. c++\野外生存(仿生火间).cpp 8.9KB
  111. c++\随机迷宫.cpp 1.57KB
  112. c++\飞机大战.cpp 3.73KB
  113. c++\鬼屋逃生.cpp 1.29KB
  114. c++\魔兽世界.cpp 9.38KB
  115. c++\魔塔(2关).cpp 2.58KB
  116. c++\鼠标点击版#字棋.cpp 1.89KB
  117. c++\龙的传人.cpp 30.73KB
  118. c++

资源介绍:

《C++小游戏集合》 这个资源包集合了一个多样化的C++编程实现的小游戏,适合对C++编程感兴趣的初学者和爱好者。C++是一种强大的、通用的面向对象编程语言,以其高效性和灵活性闻名,广泛应用于游戏开发、系统软件、嵌入式系统以及各种复杂应用的后端开发。 让我们来探讨C++在游戏开发中的应用。C++的性能优势使得它成为编写游戏引擎的理想选择,尤其是在处理实时图形和物理模拟时。它的底层访问能力和内存管理能力使得开发者能够精确控制程序运行,从而优化游戏性能。此外,C++的面向对象特性允许程序员创建模块化、可复用的代码,这对于构建复杂的游戏逻辑至关重要。 在这个小游戏集合中,你可以找到各种类型的项目,比如迷宫游戏、猜数字游戏、井字游戏等。这些游戏虽然简单,但它们涵盖了C++的基础语法、控制结构、函数、类和对象等核心概念。通过分析和修改这些代码,学习者可以加深对C++语言的理解,同时也能锻炼问题解决和逻辑思维能力。 例如,猜数字游戏可能涉及到随机数生成、条件判断和循环,这些都是C++的基础。而井字游戏则可能包含更复杂的逻辑,比如状态机的设计和游戏结束条件的判断,这将涉及面向对象设计,如类的定义和对象的交互。 这个集合中的每个游戏都是一个独立的学习实例,你可以逐个研究,理解其背后的算法和数据结构。对于初学者来说,这是实践理论知识、提高编程技能的绝佳途径。而对于有一定基础的开发者,这些游戏也可以作为进一步优化和扩展的起点,比如添加图形界面、网络多人对战功能等。 需要注意的是,由于这些游戏并非自制,因此在使用或分发时应尊重原作者的版权。如果你发现有任何侵权问题,应当按照描述中的提示,及时与发布者联系。 这个C++小游戏集合是一份宝贵的教育资源,无论你是想学习C++,还是希望找些有趣的编程项目来挑战自己,都能从中受益。通过实际操作和调试这些代码,你不仅可以提升C++编程技能,还能享受到编程带来的乐趣。所以,不要犹豫,下载下来,开始你的编程探索之旅吧!
//转自:https://www.luogu.com.cn/team/32221#main //收藏者的提示:本游戏用了thread导致c++5.11无法运行 //龙的传人无存档游玩版版1.1.2(测试版1.4.5) //代码有点长,谢谢。 //按住shift,点击代码最上面,在拖到底部,点击最下面,即可复制(Ctrl+C)。 //可嫩运行不了,不要介意... #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define edition "1.1.2" using namespace std; int health = 1000, maxhealth = 1000, damage = 100, defense = 20, force = 100, maxforce = 100, dodge = 10, hit = 10; string myname, myEnglishname, identity, mymenpai = "你还未拜师或创建门派", myshifu = "你还未拜师..."; string title = "普通百姓", title2 = "", task = ""; bool baishi, isrebound; int reboundnum, titlecolor = 16, wudaotalevel = 1; int nowroomi = 0, experience = 0, potential = 0, literate = 0, dienum = 0, killnum = 0, buildlevel = 1; int coin = 0, silver = 0, gold = 0, buildexp = 0; int password; bool gift[100]; bool ta[100]; void color(short x) { if (x >= 0 && x <= 15) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x); } else { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7); } } struct sk { string name; string use; string Englishname; int damage; int level; string weapon; int plushealth; int plusforce; int plusattack; int plusdodge; int plushit; int attacknum; int cooldown; int forceneed; bool isattack; int timedamage; }; struct th { string name; string Englishname; string tell; int coin; }; struct we { string name; string Englishname; string type; string tell; int coin; int plusdamage; int plushealth; int plusforce; int plusdefense; int plusdodge; int plushit; int lv; int inlaynum; th inlaything[10]; }; struct bo { string name; string Englishname; sk skill; int literate_need; string needskill[100]; int needlevel[100]; string tell; int coin; }; struct pe { string name; string Englishname; string tell; int health, maxhealth; int damage; int defense; int dodge, hit; int force, maxforce; we weapon; sk skills[100]; int skillsnum; bo dropbook; we dropweapon; th dropthing; bool canbai; bool canmove; }; struct ro { string name; string Englishname; string tell; pe people[100]; we weapon[100]; bo book[100]; th thing[100]; string dir[100]; int cango[100]; we weaponsell[100]; bo booksell[100]; th thingsell[100]; bool isshop; }; map GeneralAttack = { {"刀","a挥起手中x一刀朝b砍来"}, {"剑","a提起手中x朝b刺来"}, {"拳","a一拳朝b挥来"}, {"鞭","a拿起手中x朝b抽来"}, {"棍","a抡起手中x冲b一扫"}, {"抓","a一手往b抓来"} }; map weap = { {"sword",{"剑","sword","剑","这是一把普通的剑",100,100,0,0,0,-10,10,16,0,{}}}, {"longsword",{"长剑","longsword","剑","这是一把长剑",200,150,0,0,0,-5,15,16,0,{}}}, {"shortsword",{"短剑","shortsword","剑","这是一把短剑,虽然攻击力较低,但负重还可以",50,50,0,0,0,-2,5,16,0,{}}}, {"brokensword",{"断剑","brokensword","剑","这是一把已经坏了的剑,似乎经历了多年的磨砺",25,25,0,0,0,-1,10,16,0,{}}}, {"brokenblade",{"断刀","brokenblade","刀","这是一把已经坏了的刀,似乎经历了多年的磨砺",25,25,0,0,0,-1,10,16,0,{}}}, {"longblade",{"长刀","longblade","刀","这是一把长刀,可以远距离攻击",300,250,0,0,0,-10,15,16,0,{}}}, {"blade",{"钢刀","blade","刀","这是一把钢刀",2500,200,1,0,10,-10,5,16,0,{}}}, {"iron_sword",{"精铁剑","iron_sword","剑","用精铁铸成的剑,很坚硬",100,100,0,0,0,-10,10,2,0,{}}}, {"club",{"木棍","club","棍","普通的一根棍子,木头做的",700,100,0,0,0,-5,20,16,0,{}}}, {"qimeigun",{"齐眉棍","qimeigun","棍","竹子做的一根棍子,立起来恰好到眉毛",1000,150,0,0,0,-10,20,1,2,{}}}, {"ironclub",{"铁棍","ironclub","棍","铁制棍子,挥起来很有劲",1200,300,0,0,0,-20,20,2,0,{}}}, {"longclub",{"长棍","longclub","棍","一根很长的棍子,攻击范围很大",1300,300,0,0,0,-25,30,16,0,{}}}, {"whip",{"皮鞭","whip","鞭","这是一个普通的鞭子",1000,300,0,0,0,-5,20,16,0,{}}}, {"longwhip",{"长鞭","longwhip","鞭","这是一个长鞭",1100,300,0,0,0,-10,20,16,0,{}}}, {"heilong-bian",{"黑龙鞭","heilong-bian","鞭","这是黑龙史的鞭子",5000,1000,10,10,0,-10,30,1,2,{}}}, {"yunlong-bian",{"云龙鞭","yunlong-bian","鞭","这是云龙长老的鞭子",5000,1000,10,10,0,-10,30,1,2,{}}}, {"云龙剑",{}}, {"拂尘",{}}, {"将军剑",{}}, {"大砍刀",{}}, {"打狗棍",{}}, {"倚天剑",{}}, {"屠龙刀",{}}, {"武当长剑",{}}, {"太极剑",{}}, {"八卦剑",{}}, {"八卦刀",{}}, {"八荒刀",{}}, {"武士刀",{}}, {"武当长剑",{}}, {"黑龙鞭",{}}, {"云龙鞭",{}}, {"sword2",{"宝剑","sword","剑","这是一把宝剑",1000,100,10,10,1,-15,30,1}}, }; pe lvpeople[100] = { {"张慧文","guard","他是武道塔1层的守卫者,你需要打败他,才能进入2层",1000,1000,100,10,1000,1000,0,0,{"精铁剑","iron_sword","剑","用精铁铸成的剑,很坚硬",100,100,0,0,0,-10,10,16},{},0,{},{},{},false}, {"张楚嫣","guard","她是武道塔2层的守卫者,你需要打败她,才能进入3层",2658,2658,158,27,2521,913,0,0,{"精铁剑","iron_sword","剑","用精铁铸成的剑,很坚硬",100,100,0,0,0,-10,10,16},{},0,{},{},{},false}, {"张晓彤","guard","她是武道塔3层的守卫者,你需要打败她,才能进入4层",3479,3479,227,38,3042,1013,1000,1000,{"精铁剑","iron_sword","剑","用精铁铸成的剑,很坚硬",100,100,0,0,0,-10,10,16},{{"「武当剑法」", "e一式「2三环套月s」,连续三招,手中q化作三道光朝你飞来", "wudang-sword", 454, 10, "剑", 2, 2, 2, 2, 2, 3, 3, 1, true, 2}},1,{},{},{},false}, {"张楚涵","guard","她是武道塔4层的守卫者,你需要打败她,才能进入5层",7332,7332,348,75,2328,3328,1000,1000,{"精铁剑","iron_sword","剑","用精铁铸成的剑,很坚硬",100,100,0,0,0,-10,10,16},{{"「武当剑法」", "e一式「2三环套月s」,连续三招,手中q化作三道光朝你飞来", "wudang-sword", 696, 20, "剑", 2, 2, 2, 2, 2, 3, 3, 1, true, 2}},1,{},{},{},false}, {"张鸿瑞","guard","他是武道塔5层的守卫者,你需要打败他,才能进入6层",3479,3479,227,38,3042,1013,1000,1000,{"精铁剑","iron_sword","剑","用精铁铸成的剑,很坚硬",100,100,0,0,0,-10,10,16},{{"「武当剑法」", "e一式「2三环套月s」,连续三招,手中q化作三道光朝你飞来", "wudang-sword", 454, 10, "剑", 2, 2, 2, 2, 2, 3, 3, 1, true, 2}},1,{},{},{},false}, }; sk ZhangSanfeng_skills[8] = { {"「武当剑法」", "e一式「2三环套月s」,连续三招,手中q化作三道光朝你飞来", "wudang-sword", 100000, 1000, "剑", 2, 2, 2, 2, 2, 3, 3, 1, true, 2}, {"「太极剑」", "e虚步提腰,一招「6蜻蜓点水s」,手中q轻轻颤动,一剑剑点向你", "taiji-sword", 100000, 1000, "剑", 10, 10, 10, 10, 10, 3, 3, 1, true, 2}, {"「太极拳」", "e左手回收,右手由钩变掌,由右向左,使一招「6提手上式s」,向你打来", "taiji-fist", 100000, 1000, "拳", 1000, 500, 500, 100, 10, 5, 10, 1, true, 1}, {"「昊天掌」", "e使一招「5海上明月s」,左手轻轻一挥,劈向你", "haotian-fist", 10000, 1000, "拳", 2, 2, 2, 2, 2, 3, 3, 50, true, 3}, {"「空明拳」", "你凝神聚力,以极快的速度出拳\n\t4空明拳之意!s", "kongming-fist", 50000, 1000, "拳", 1000, 500, 500, 100, 10, 1, 10, 200, true, 10}, {"「云梯纵」", "e双手一挥,脚尖点地,一招「1云梯纵s」,瞬间变到了你的身后,使你的招数统统落空", "yunti-zong", 0, 1000, "无", 2, 2, 2, 2, 2, 3, 3, 0, false, 0}, {"「武当身法」", "你一招「2移步换行s」,双脚一用力,往旁边一闪,瞬间将e的招数躲了过去", "wudang-step", 0, 1000, "无", 0, 0, 0, 3, 0, 0, 0, 20, false, 0}, {"「先天太极」", "你运转先天真气,双掌回圈,顿时一波澎湃的气劲直袭e,正是所学6先天太极
100+评论
captcha