C ++ console games

-C ++ game programming entry


Brief introduction

    Use C ++ to write some simple nostalgia of the game, which did not materialize play like, only to realize the core functions

Operating instructions

Windows is the operating platform

    Download the archive or use git will do, use after the completion of clion (cmake support other projects also, the need to configure the environment, visual studio should be), you can run load works

git clone https://github.com/lw1243925457/LearnGameC.git

    Environment configuration may refer to this slightly: https: //github.com/lw1243925457/LOG/blob/master/profession/program/C%2B%2B/windows%E7%8E%AF%E5%A2%83%E9% 85% 8D% E7% BD% AE.md

game menu

  • Digital Rain (movie window can not read a lot of stuff is cool, it is a simple simulation)
  • Sokoban
  • Snake
  • Tetris (using special symbols that are easily garbled, not a good deal, simply use the * and #, looking a little vertigo ...)
  • Space Shooter (No deaths)

Digital Rain

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-uMWmr08a-1581489036627)(./picture/codeRain.png)]

Sokoban

  • Summary:

    • Simple Sokoban game that will push all the boxes to the destination can be
  • Game symbol:

    • obstacle:#
    • protagonist:*
    • Box: $
    • destination:@
    • Box + Destination:!
    • People + destination: R
  • Game control:

    • Up and down movement control keys

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-lRMi600Q-1581489036629)(./picture/box.gif)]

Snake

  • Summary:

    • Snake game, Pacman longer
  • Game symbol:

    • obstacle:#
    • Snakehead: 0
    • Snake: o
    • beans:*
  • Game control:

    • Up and down movement control keys
    • Space to start the game

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-I2jqBHdH-1581489036629)(./picture/snake.gif)]

Tetris

  • Summary:

    • Tetris
  • Game symbol:

    • obstacle:#
    • Box: *
  • Game control:

    • The left and right movement control keys
    • Space is transformed

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-Yu4A0JO9-1581489036630)(./picture/tetris.gif)]

Space Shooter

  • Summary:

    • Space shooter, simple shooting game
  • Game symbol:

    • Protagonist: A
    • Child 弹: I
    • Enemy: V
  • Game control:

    • The left and right movement control keys
    • Space to shoot

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-SOCoEpLn-1581489036630)(./picture/shot.gif)]

编写过程中的参考链接

  • C/C++获取系统时间戳,精确到毫秒:https://blog.csdn.net/liyunlong41/article/details/76933575

  • C++写一个限时输入功能,超过时间执行其他操作:https://blog.csdn.net/dulingmo/article/details/81077071

  • CLion 输出遇到乱码解决办法:https://blog.csdn.net/Cbk_XLL/article/details/78752534

  • win10 Clion debug 使用 cmd控制台:https://blog.csdn.net/qq_32767041/article/details/

  • C++ 中的容器类详解:https://blog.csdn.net/tju_fengbo/article/details/81978595

  • C语言 双缓冲控制台防闪屏技术:https://blog.csdn.net/weixinhum/article/details/72179593

  • 控制台双缓冲技术:https://www.cnblogs.com/xdblog/p/4783364.html

  • C程序之修改Windows的控制台大小:https://www.cnblogs.com/iloverain/p/5642588.html

  • C语言/C++程序员大神打造炫酷的黑客帝国数字雨:https://www.jianshu.com/p/4dde809eb039

  • C/C++实现控制台输出不同颜色字体的方法:https://www.jb51.net/article/124054.htm

  • C ++ to change the console (SetConsoleTextAttribute) color output: https: //blog.csdn.net/TweeChalice/article/details/96496625

  • In a plane, a point about an arbitrary point coordinates rotated θ degrees: https: //www.cnblogs.com/fengliu-/p/10944151.html

  • Tetris correlation algorithm: https: //zhuanlan.zhihu.com/p/32122479

  • How to output on VC 6.0 special symbols such as a black solid square: https: //blog.csdn.net/ahuang1900/article/details/8948672

Published 25 original articles · won praise 2 · Views 9451

Guess you like

Origin blog.csdn.net/github_35735591/article/details/104278438