找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4471|回复: 3
打印 上一主题 下一主题
收起左侧

C语言做的推箱子游戏源程序

[复制链接]
跳转到指定楼层
楼主
这是我自己做的一个推箱子游戏,灵感来源于无意间在网上看到过类似的程序。从开始做到完善几乎半个月左右
第一次做的时候只有简单的推箱子,也没用图形化界面,箱子,人物等这些都是用一些符号代替
进过后面不断改进,如今也加上了图片,新增加了几个关卡,同时每一个关卡都有完成本关的最高记录
下面会附上一些图片的代相关码


单片机源程序如下:
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<graphics.h> //图形界面
  4. #include<iostream>
  5. #include<fstream>

  6. using namespace std;
  7. #define VK_SHIFT  0x10
  8. #pragma warning(disable:4996)//使用sprintf时需要的头文件

  9. int a, b, X, Y;
  10. int g = 0;
  11. int t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0;
  12. int map2D[9][10] = {
  13.         9, 9, 1, 1, 1, 1, 1, 1, 1, 1 ,
  14.         9, 9, 1, 0, 0, 0, 1, 2, 0, 1 ,
  15.         9, 1, 1, 0, 0, 3, 2, 2, 2, 1 ,
  16.         9, 1, 0, 0, 3, 0, 1, 5, 2, 1 ,
  17.         1, 1, 0, 1, 1, 3, 1, 0, 1, 1 ,
  18.         1, 0, 0, 0, 3, 0, 0, 3, 0, 1 ,
  19.         1, 0, 0, 0, 1, 0, 0, 0, 0, 1 ,
  20.         1, 1, 1, 1, 1, 1, 1, 4, 0, 1 ,
  21.         9, 9, 9, 9, 9, 9, 1, 1, 1, 1
  22. }; //0空地,1墙,2目的地,4和6人物(玩家),3箱子,9背景

  23. int mapSecond[9][10] = {
  24.         9, 9, 1, 1, 1, 1, 1, 1, 1, 1,
  25.         9, 9, 1, 0, 0, 0, 1, 2, 0, 1,
  26.         9, 1, 1, 0, 0, 3, 2, 2, 2, 1,
  27.         9, 1, 0, 0, 3, 0, 1, 5, 2, 1,
  28.         1, 1, 0, 1, 1, 3, 1, 0, 1, 1,
  29.         1, 0, 0, 0, 3, 0, 0, 3, 0, 1,
  30.         1, 0, 0, 0, 1, 0, 0, 0, 0, 1,
  31.         1, 1, 1, 1, 1, 1, 1, 4, 0, 1,
  32.         9, 9, 9, 9, 9, 9, 1, 1, 1, 1
  33. };

  34. int mapSecond1[9][10] = {
  35.         1, 1, 1, 1, 1, 1, 1, 1, 9, 9,
  36.         1, 0, 0, 1, 0, 0, 0, 1, 9, 9,
  37.         1, 0, 3, 2, 2, 3, 0, 1, 9, 9,
  38.         1, 4, 3, 2, 5, 0, 1, 1, 9, 9,
  39.         1, 0, 3, 2, 2, 3, 0, 1, 9, 9,
  40.         1, 0, 0, 1, 0, 0, 0, 1, 9, 9,
  41.         1, 1, 1, 1, 1, 1, 1, 1, 9, 9,
  42.         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  43.         9, 9, 9, 9, 9, 9, 9, 9, 9, 9
  44. };
  45. int mapSecond2[9][10] = {
  46.         9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  47.         9, 9, 9, 1, 1, 1, 1, 9, 9, 9,
  48.         9, 9, 1, 1, 0, 0, 1, 9, 9, 9,
  49.         9, 9, 1, 4, 3, 0, 1, 9, 9, 9,
  50.         9, 9, 1, 1, 3, 0, 1, 1, 9, 9,
  51.         9, 9, 1, 1, 0, 3, 0, 1, 9, 9,
  52.         9, 9, 1, 2, 3, 0, 0, 1, 9, 9,
  53.         9, 9, 1, 2, 2, 5, 2, 1, 9, 9,
  54.         9, 9, 9, 9, 9, 9, 9, 9, 9, 9
  55. };
  56. int mapSecond3[9][10] = {
  57.         9, 9, 1, 1, 1, 1, 1, 1, 9, 9,
  58.         9, 9, 1, 2, 0, 2, 2, 1, 9, 9,
  59.         9, 9, 1, 2, 0, 3, 2, 1, 9, 9,
  60.         9, 1, 1, 1, 0, 0, 3, 1, 1, 9,
  61.         9, 1, 0, 3, 0, 0, 3, 0, 1, 9,
  62.         9, 1, 0, 1, 3, 1, 1, 0, 1, 9,
  63.         9, 1, 0, 0, 0, 4, 0, 0, 1, 9,
  64.         9, 1, 1, 1, 1, 1, 1, 1, 1, 9,
  65.         9, 9, 9, 9, 9, 9, 9, 9, 9, 9
  66. };
  67. int mapSecond4[9][10] = {
  68.         1, 1, 1, 1, 1, 9, 9, 9, 9, 9,
  69.         1, 0, 0, 0, 1, 1, 1, 1, 1, 9,
  70.         1, 0, 1, 0, 1, 0, 0, 0, 1, 9,
  71.         1, 0, 3, 0, 0, 0, 3, 0, 1, 9,
  72.         1, 2, 2, 1, 3, 1, 3, 1, 1, 9,
  73.         1, 2, 4, 3, 0, 0, 0, 1, 9, 9,
  74.         1, 2, 2, 0, 0, 1, 1, 1, 9, 9,
  75.         1, 1, 1, 1, 1, 1, 9, 9, 9, 9,
  76.         9, 9, 9, 9, 9, 9, 9, 9, 9, 9
  77. };


  78. void repeat(){
  79.         if (t1 == 1){
  80.                 for (int i = 0; i < 9; i++){
  81.                         for (int j = 0; j < 10; j++){
  82.                                 map2D[i][j] = mapSecond[i][j];
  83.                         }
  84.                 }
  85.         }
  86. }

  87. void repeat1(){
  88.         if (t2 == 1){
  89.                 for (int i = 0; i < 9; i++){
  90.                         for (int j = 0; j < 10; j++){
  91.                                 map2D[i][j] = mapSecond1[i][j];
  92.                         }
  93.                 }
  94.         }
  95. }
  96. void repeat2(){
  97.         if (t3 == 1){
  98.                 for (int i = 0; i < 9; i++){
  99.                         for (int j = 0; j < 10; j++){
  100.                                 map2D[i][j] = mapSecond2[i][j];
  101.                         }
  102.                 }
  103.         }
  104. }
  105. void repeat3(){
  106.         if (t4 == 1){
  107.                 for (int i = 0; i < 9; i++){
  108.                         for (int j = 0; j < 10; j++){
  109.                                 map2D[i][j] = mapSecond3[i][j];
  110.                         }
  111.                 }
  112.         }
  113. }
  114. void repeat4(){
  115.         if (t5 == 1){
  116.                 for (int i = 0; i < 9; i++){
  117.                         for (int j = 0; j < 10; j++){
  118.                                 map2D[i][j] = mapSecond4[i][j];
  119.                         }
  120.                 }
  121.         }
  122. }



  123. void initmap()
  124. {
  125.         IMAGE map[7];
  126.         char filename[20] = "";
  127.         for (int i = 0; i < 7; i++)
  128.         {
  129.                 sprintf_s(filename, "素材/%d.jpg", i);
  130.                 loadimage(&map[i], filename, 20, 20);
  131.         }
  132.         int x, y;
  133.         for (int rowNum = 0; rowNum < 9; rowNum++)
  134.         {
  135.                 for (int colNum = 0; colNum < 10; colNum++)
  136.                 {
  137.                         x = colNum * 20+100;
  138.                         y = rowNum * 20+60;
  139.                         putimage(x, y, &map[map2D[rowNum][colNum]]);
  140.                 }
  141.         }
  142. }
  143. void playGame()
  144. {
  145.         //a为行,b列
  146.         for (int i = 0; i < 9; i++){
  147.                 for (int j = 0; j < 10; j++){
  148.                         if (map2D[i][j] == 4 || map2D[i][j] == 6){
  149.                                 a = i;
  150.                                 b = j;
  151.                                 X = a;
  152.                                 Y = b;
  153.                         }
  154.                 }
  155.         }
  156.         char ch;
  157.         ch = getch();
  158.         switch (ch)
  159.         {
  160.         case 'T':
  161.         case 't':
  162.                 g = 1;
  163.                 break;
  164.                 //0空地,1墙,2目的地,4人物(玩家),3箱子
  165.                
  166.         case 'W':
  167.         case 'w':
  168.         case 72:
  169.                 if (map2D[a - 1][b] == 0)
  170.                 {
  171.                         map2D[a - 1][b] += 4;
  172.                         map2D[a][b] -= 4;
  173.                 }
  174.                 else if (map2D[a - 1][b] == 2)
  175.                 {
  176.                         map2D[a - 1][b] += 4;
  177.                         map2D[a][b] -= 4;
  178.                 }
  179.                 else if (map2D[a - 1][b] == 3 || map2D[a - 1][b] == 5)//人前面是箱子或者箱子+目的地
  180.                 {
  181.                         if (map2D[a - 1][b] == 3)
  182.                         {
  183.                                 if (map2D[a - 2][b] == 0)
  184.                                 {
  185.                                         map2D[a - 2][b] += 3;
  186.                                         map2D[a - 1][b] += 1;
  187.                                         map2D[a][b] -= 4;
  188.                                 }
  189.                                 else if (map2D[a - 2][b] == 2)
  190.                                 {
  191.                                         map2D[a - 2][b] += 3;
  192.                                         map2D[a - 1][b] += 1;
  193.                                         map2D[a][b] -= 4;
  194.                                 }
  195.                         }
  196.                         else//前面是5
  197.                         {
  198.                                 if (map2D[a - 2][b] == 0)
  199.                                 {
  200.                                         map2D[a - 2][b] += 3;
  201.                                         map2D[a - 1][b] += 1;
  202.                                         map2D[a][b] -= 4;
  203.                                 }
  204.                                 else if (map2D[a - 2][b] == 2)
  205.                                 {
  206.                                         map2D[a - 2][b] += 3;
  207.                                         map2D[a - 1][b] += 1;
  208.                                         map2D[a][b] -= 4;
  209.                                 }
  210.                         }

  211.                 }
  212.                 for (int i = 0; i < 9; i++){
  213.                         for (int j = 0; j < 10; j++){
  214.                                 if (map2D[i][j] == 4 || map2D[i][j] == 6){
  215.                                         a = i;
  216.                                         b = j;
  217.                                 }
  218.                         }
  219.                 }
  220.                 break;
  221.         case 'S':
  222.         case 's':
  223.         case 80:
  224.                 if (map2D[a + 1][b] == 0)
  225.                 {
  226.                         map2D[a + 1][b] += 4;
  227.                         map2D[a][b] -= 4;
  228.                 }
  229.                 else if (map2D[a + 1][b] == 2)
  230.                 {
  231.                         map2D[a + 1][b] += 4;
  232.                         map2D[a][b] -= 4;
  233.                 }
  234.                 else if (map2D[a + 1][b] == 3 || map2D[a + 1][b] == 5)//人前面是箱子或者箱子+目的地
  235.                 {
  236.                         if (map2D[a + 1][b] == 3)
  237.                         {
  238.                                 if (map2D[a + 2][b] == 0)
  239.                                 {
  240.                                         map2D[a + 2][b] += 3;
  241.                                         map2D[a + 1][b] += 1;
  242.                                         map2D[a][b] -= 4;
  243.                                 }
  244.                                 else if (map2D[a + 2][b] == 2)
  245.                                 {
  246.                                         map2D[a + 2][b] += 3;
  247.                                         map2D[a + 1][b] += 1;
  248.                                         map2D[a][b] -= 4;
  249.                                 }
  250.                         }
  251.                         else
  252.                         {
  253.                                 if (map2D[a + 2][b] == 0)
  254.                                 {
  255.                                         map2D[a + 2][b] += 3;
  256.                                         map2D[a + 1][b] += 1;
  257.                                         map2D[a][b] -= 4;
  258.                                 }
  259.                                 else if (map2D[a + 2][b] == 2)
  260.                                 {
  261.                                         map2D[a + 2][b] += 3;
  262.                                         map2D[a + 1][b] += 1;
  263.                                         map2D[a][b] -= 4;
  264.                                 }
  265.                         }

  266.                 }
  267.                 for (int i = 0; i < 9; i++){
  268.                         for (int j = 0; j < 10; j++){
  269.                                 if (map2D[i][j] == 4 || map2D[i][j] == 6){
  270.                                         a = i;
  271.                                         b = j;
  272.                                 }
  273.                         }
  274.                 }
  275.                 break;
  276.         case 'A':
  277.         case 'a':
  278.         case 75:
  279.                 if (map2D[a][b - 1] == 0)
  280.                 {
  281.                         map2D[a][b - 1] += 4;
  282.                         map2D[a][b] -= 4;
  283.                 }
  284.                 else if (map2D[a][b - 1] == 2)
  285.                 {
  286.                         map2D[a][b - 1] += 4;
  287.                         map2D[a][b] -= 4;
  288.                 }
  289.                 else if (map2D[a][b - 1] == 3 || map2D[a][b - 1] == 5)//人前面是箱子或者箱子+目的地
  290.                 {
  291.                         if (map2D[a][b - 1] == 3)
  292.                         {
  293.                                 if (map2D[a][b - 2] == 0)
  294.                                 {
  295.                                         map2D[a][b - 2] += 3;
  296.                                         map2D[a][b - 1] += 1;
  297.                                         map2D[a][b] -= 4;
  298.                                 }
  299.                                 else if (map2D[a][b - 2] == 2)
  300.                                 {
  301.                                         map2D[a][b - 2] += 3;
  302.                                         map2D[a][b - 1] += 1;
  303.                                         map2D[a][b] -= 4;
  304.                                 }
  305.                         }
  306.                         else
  307.                         {
  308.                                 if (map2D[a][b - 2] == 0)
  309.                                 {
  310.                                         map2D[a][b - 2] += 3;
  311.                                         map2D[a][b - 1] += 1;
  312.                                         map2D[a][b] -= 4;
  313.                                 }
  314.                                 else if (map2D[a][b - 2] == 2)
  315.                                 {
  316.                                         map2D[a][b - 2] += 3;
  317.                                         map2D[a][b - 1] += 1;
  318.                                         map2D[a][b] -= 4;
  319.                                 }
  320.                         }

  321.                 }
  322.                 for (int i = 0; i < 9; i++){
  323.                         for (int j = 0; j < 10; j++){
  324.                                 if (map2D[i][j] == 4 || map2D[i][j] == 6){
  325.                                         a = i;
  326.                                         b = j;
  327.                                 }
  328.                         }
  329.                 }
  330.                 break;
  331.         case 'D':
  332.         case 'd':
  333.         case 77:
  334.                 if (map2D[a][b + 1] == 0)
  335.                 {
  336.                         map2D[a][b + 1] += 4;
  337.                         map2D[a][b] -= 4;
  338.                 }
  339.                 else if (map2D[a][b + 1] == 2)
  340.                 {
  341.                         map2D[a][b + 1] += 4;
  342.                         map2D[a][b] -= 4;
  343.                 }
  344.                 else if (map2D[a][b + 1] == 3 || map2D[a][b + 1] == 5)//人前面是箱子或者箱子+目的地
  345.                 {
  346.                         if (map2D[a][b + 1] == 3)
  347.                         {
  348.                                 if (map2D[a][b + 2] == 0)
  349.                                 {
  350.                                         map2D[a][b + 2] += 3;
  351.                                         map2D[a][b + 1] += 1;
  352.                                         map2D[a][b] -= 4;
  353.                                 }
  354.                                 else if (map2D[a][b + 2] == 2)
  355.                                 {
  356.                                         map2D[a][b + 2] += 3;
  357.                                         map2D[a][b + 1] += 1;
  358.                                         map2D[a][b] -= 4;
  359.                                 }
  360.                         }
  361.                         else
  362.                         {
  363.                                 if (map2D[a][b + 2] == 0)
  364.                                 {
  365.                                         map2D[a][b + 2] += 3;
  366.                                         map2D[a][b + 1] += 1;
  367.                                         map2D[a][b] -= 4;
  368.                                 }
  369.                                 else if (map2D[a][b + 2] == 2)
  370.                                 {
  371.                                         map2D[a][b + 2] += 3;
  372.                                         map2D[a][b + 1] += 1;
  373.                                         map2D[a][b] -= 4;
  374.                                 }
  375.                         }

  376.                 }
  377.                 for (int i = 0; i < 9; i++){
  378.                         for (int j = 0; j < 10; j++){
  379.                                 if (map2D[i][j] == 4 || map2D[i][j] == 6){
  380.                                         a = i;
  381.                                         b = j;
  382.                                 }
  383.                         }
  384.                 }
  385.                 break;

  386.         }

  387. }


  388. int main()
  389. {       
  390.         int dat, I;
  391.         int P = 6;//过关条件
  392.         t1 = 1;
  393.         char q[20] = "";
  394.         int w[5] = { 0 };//存放最高纪录
  395.         char m[20] = "";
  396.         int d, h;
  397. xin:
  398.         dat = 0, I = 0, a = 0, b = 0;
  399.         if (t1 == 1 || t2 == 1) {
  400.                 P = 6;
  401.         }
  402.         else if (t3 == 1 || t4 == 1 || t5 == 1){
  403.                 P = 5;
  404.         }

  405.         d = 0, h = 0;//d为当前步数,h为最高步数
  406.         initgraph(400, 550);
  407.         repeat();
  408.         repeat1();
  409.         repeat2();
  410.         repeat3();
  411.         repeat4();
  412.         for (int i = 0; i < 2000; i++){

  413.                 cleardevice();//清屏
  414.                 int R = 0;
  415.                 outtextxy(28, 0, "注:1.开始游戏前需要点击shift键后才能使用;");
  416.                 outtextxy(60, 20, "2.不可以悔棋,按T键可以重新开始本关卡。");
  417.                 sprintf(m, "当前已经走了%d步", I);
  418.                 outtextxy(130, 300, m);
  419.                 for (int k = 0; k < 9; k++)
  420.                 {
  421.                         for (int j = 0; j < 10; j++)
  422.                         {
  423.                                 if (map2D[k][j] == 5){
  424.                                         R = R + 1;
  425.                                 }
  426.                         }
  427.                 }
  428.                
  429.                 initmap();
  430.                 d = i;
  431.                 if (R == P)
  432.                         break;
  433.                 playGame();

  434.                 if (a != X||b != Y){  //X,Y为玩家当前位置的上一个位置的坐标
  435.                         I++;
  436.                 }
  437.                 if (g == 1){
  438.                         g = 0;
  439.                         goto xin;
  440.                 }

  441.         }
  442.         outtextxy(130, 320, "恭喜过关!");

  443.         if (t1 == 1){
  444.                 dat = 0;
  445.                 ifstream infile("file/xin.dat", ios::in);
  446.                 if (!infile){

  447.                 }
  448.                 else{
  449.                         infile >> w[dat];
  450.                         h = w[dat];
  451.                 }
  452.                 infile.close();
  453.                 if (h == 0 || d < h) {
  454.                         ofstream outfile("file/xin.dat", ios::out);
  455.                         h = d;
  456.                         w[dat] = h;
  457.                         outfile << w[dat];
  458.                         outfile.close();
  459.                 }
  460.         }
  461.         else if (t2 == 1){
  462.                 dat = 1;
  463.                 ifstream infile("file/xin1.dat", ios::in);
  464.                 if (!infile){

  465.                 }
  466.                 else{
  467.                         infile >> w[dat];
  468.                         h = w[dat];
  469.                 }
  470.                 infile.close();
  471.                 if (h == 0 || d < h) {
  472.                         ofstream outfile("file/xin1.dat", ios::out);
  473.                         h = d;
  474.                         w[dat] = h;
  475.                         outfile << w[dat];
  476.                         outfile.close();
  477.                 }
  478.         }
  479.         else if (t3 == 1){
  480.                 dat = 2;
  481.                 ifstream infile("file/xin2.dat", ios::in);
  482.                 if (!infile){

  483.                 }
  484.                 else{
  485.                         infile >> w[dat];
  486.                         h = w[dat];
  487.                 }
  488.                 infile.close();
  489.                 if (h == 0 || d < h) {
  490.                         ofstream outfile("file/xin2.dat", ios::out);
  491.                         h = d;
  492.                         w[dat] = h;
  493.                         outfile << w[dat];
  494.                         outfile.close();
  495.                 }
  496.         }
  497.         else if (t4 == 1){
  498.                 dat = 3;
  499.                 ifstream infile("file/xin3.dat", ios::in);
  500.                 if (!infile){

  501.                 }
  502.                 else{
  503.                         infile >> w[dat];
  504.                         h = w[dat];
  505.                 }
  506.                 infile.close();
  507.                 if (h == 0 || d < h) {
  508.                         ofstream outfile("file/xin3.dat", ios::out);
  509.                         h = d;
  510.                         w[dat] = h;
  511.                         outfile << w[dat];
  512.                         outfile.close();
  513.                 }
  514.         }
  515.         else if (t5 == 1){
  516.                 dat = 4;
  517.                 ifstream infile("file/xin4.dat", ios::in);
  518.                 if (!infile){

  519.                 }
  520.                 else{
  521.                         infile >> w[dat];
  522.                         h = w[dat];
  523.                 }
  524.                 infile.close();
  525.                 if (h == 0 || d < h) {
  526.                         ofstream outfile("file/xin4.dat", ios::out);
  527.                         h = d;
  528.                         w[dat] = h;
  529.                         outfile << w[dat];
  530.                         outfile.close();
  531.                 }
  532.         }

  533.         //ifstream infile("file/xin.dat", ios::in);
  534.         //if (!infile){

  535.         //}
  536.         //else{
  537.         //        infile >> w[dat];
  538.         //        h = w[dat];
  539.         //}
  540.         //infile.close();
  541.         //if (h == 0 || d < h) {
  542.         //        ofstream outfile("file/xin.dat", ios::out);
  543.         //        h = d;
  544.         //        w[dat] = h;
  545.         //        outfile << w[dat];
  546.         //        outfile.close();
  547.         //}
  548.         sprintf(q, "当前关卡最高纪录为%d步", w[dat]);
  549.         outtextxy(130, 350, q);

  550.         outtextxy(130, 400, "是否重新挑战?(Y/N)");
  551.         char ch, cha;
  552.         ch = getch();
  553.         switch (ch){
  554.         case 'Y':
  555.         case 'y':
  556.                 outtextxy(130, 420, "加载中......");
  557.                 Sleep(1500);
  558.                 goto xin;
  559.                 break;
  560.         default:
  561.                 break;
  562.         }
  563.         outtextxy(80, 420, "请选择关卡(1,2,3,4,5,0[退出])");
  564.         faulse:
  565.         cha = getch();
  566.         switch (cha){
  567.         case '1':
  568.                 t1 = 0; t2 = 0, t3 = 0, t4 = 0, t5 = 0;
  569.                 t1 = 1;
  570.                 goto xin;
  571.                 break;
  572.         case '2':
  573.                 t1 = 0; t2 = 0, t3 = 0, t4 = 0, t5 = 0;
  574.                 t2 = 1;
  575.                 goto xin;
  576.                 break;
  577.         case '3':
  578.                 t1 = 0; t2 = 0, t3 = 0, t4 = 0, t5 = 0;
  579.                 t3 = 1;
  580.                 goto xin;
  581.                 break;
  582.         case '4':
  583.                 t1 = 0; t2 = 0, t3 = 0, t4 = 0, t5 = 0;
  584.                 t4 = 1;
  585.                 goto xin;
  586.                 break;
  587.         case '5':
  588.                 t1 = 0; t2 = 0, t3 = 0, t4 = 0, t5 = 0;
  589.                 t5 = 1;
  590.                 goto xin;
  591.                 break;
  592.         case '0':
  593.                 outtextxy(150, 450, "按enter键继续退出!");
  594.                 break;
  595. ……………………

  596. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
推箱子.zip (12.61 KB, 下载次数: 26)

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:517444 发表于 2019-5-26 12:28 | 只看该作者
请问你是用什么显示的呢
回复

使用道具 举报

板凳
ID:425825 发表于 2019-5-26 17:14 | 只看该作者
不靠谱的萌猪 发表于 2019-5-26 12:28
请问你是用什么显示的呢

这个游戏是电脑上玩的,不是用的单片机
回复

使用道具 举报

地板
ID:545734 发表于 2019-5-27 13:42 | 只看该作者
不靠谱的萌猪 发表于 2019-5-26 12:28
请问你是用什么显示的呢

这是用C语言写的程序,只要你电脑上有可以写c/c++的软件,你就可以自己创建一个工程,再创建一个源程序,将代码复制到里面基本就可以用了。我用的是VS2013这个软件。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表