Giter Club home page Giter Club logo

pushbox's Introduction

说明

该游戏使用了SDL2游戏开发库,c++语法是c++11标准。因为SDL2是跨平台的游戏开发库,所以该游戏的源码可以直接在linux上面编译成功。

游戏运行截图

游戏开始界面 游戏开始界面

游戏成功界面

游戏结束界面

游戏更换关卡

源代码里面没有自动生成关卡的代码,游戏的关卡需要从文件读取,读取方式如下

游戏更换关卡

一些补充说明

  • 如果要更换关卡,请打开round.txt和win.txt,它们两个分别对应着 关卡初始布局和关卡赢了后的布局。

  • 控制人物移动方向使用上下左右键

  • 代码里面的矩阵分别代表什么元素

    • 0:代表什么都没有
    • 1:代表墙
    • 2:代表箱子
    • 3:代表玩家
    • 4:代表坑位1:代表墙
  • 游戏矩阵如下

            int t[20][20] = {
                  	{ 0,0,1,1,1,0,0,0 },
                  	{ 0,0,1,4,1,0,0,0 },
                  	{ 0,0,1,0,1,1,1,1 },
                  	{ 1,1,1,2,0,2,4,1 },
                  	{ 1,4,0,2,3,1,1,1 },
                  	{ 1,1,1,1,2,1,0,0 },
                  	{ 0,0,0,1,4,1,0,0 },
                  	{ 0,0,0,1,1,1,0,0 }
                  };

pushbox's People

Contributors

karentwan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

fician

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.