├── .gitignore ├── README.md ├── README.textClipping ├── README ├── XTFpicture.png ├── gamePanelExample.png ├── gamePanelExample_en.png ├── playerFigure.md ├── playerFigureExp.png ├── playerFigureGIF.gif ├── startFace.png ├── startFace_en.png ├── structureDesign.gif └── structureDesign.md ├── README_ch.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── index.html ├── nprogress.css └── nprogress.js ├── src ├── App.vue ├── components │ ├── gameDesign │ │ ├── lib │ │ │ └── transversion.js │ │ └── structureDesign.vue │ ├── helpPage │ │ ├── helpForEntireGame.vue │ │ ├── helpForFaceDesign.vue │ │ ├── helpForGameDesign.vue │ │ ├── helpForPlayerFigure.vue │ │ └── lib │ │ │ └── _cssStyle.scss │ ├── playerFigure │ │ ├── PictureCombine.vue │ │ ├── PictureEdit.vue │ │ └── lib │ │ │ ├── eraseCanvasTool.js │ │ │ ├── imgSource.js │ │ │ └── posStringToNumber.js │ └── startUpAndEnd │ │ ├── componentMixin.js │ │ ├── faceComponent.vue │ │ ├── filterGroup.js │ │ ├── pictureComponent.vue │ │ └── textComponent.vue ├── lib │ ├── _consistentStyle.scss │ ├── gameLevel.js │ ├── gameTemplate.js │ ├── levelTemplate.js │ ├── mobileRouterProtect.js │ ├── previewPageData.js │ ├── pureGame.js │ └── rangeInputStyle.css ├── main.js ├── pic │ ├── helpPage │ │ ├── donePlayerFigure.png │ │ ├── endFaceAnimation.png │ │ ├── enterEntireGame.png │ │ ├── entireGameIntro.png │ │ ├── entireGamePanelIntro.png │ │ ├── faceDesignPanelIntro.png │ │ ├── faceDesignResult.png │ │ ├── gameDesignPanelIntro.png │ │ ├── gameDesignResult.png │ │ ├── pictureCombinePanelIntro.png │ │ ├── playerCrop.png │ │ ├── playerFIgurePanelIntro.png │ │ ├── playerFigureErase.png │ │ ├── playerFigureResult.png │ │ ├── selectFaceDesign.png │ │ ├── selectGameDesign.png │ │ ├── selectPlayerFigure.png │ │ └── structureDesignPanelIntro.png │ ├── home │ │ ├── DIYGAMElogo.png │ │ ├── firstPoster.png │ │ ├── secondPoster.png │ │ └── thirdPoster.jpg │ ├── playerFigure │ │ ├── headless.png │ │ └── oneBody.png │ ├── preViewPage │ │ ├── DIYGAMElogo.png │ │ ├── endFaceBackground.jpg │ │ ├── previewLevelBackground1.jpg │ │ ├── previewLevelBackground2.png │ │ └── previewPagePlayer.png │ ├── pureGame │ │ ├── Monster1.png │ │ ├── Monster2.png │ │ ├── Monster3.png │ │ ├── Monster4.png │ │ ├── dragon1.png │ │ ├── dragon10.png │ │ ├── dragon2.png │ │ ├── dragon3.png │ │ ├── dragon4.png │ │ ├── dragon5.png │ │ ├── dragon6.png │ │ ├── dragon7.png │ │ ├── dragon8.png │ │ ├── dragon9.png │ │ ├── fire1.png │ │ ├── fire2.png │ │ ├── fire3.png │ │ ├── fire4.png │ │ ├── player.png │ │ ├── rose.png │ │ ├── sprites.png │ │ ├── tofire1.png │ │ ├── tofire2.png │ │ ├── tofire3.png │ │ ├── tofire4.png │ │ ├── tofire5.png │ │ ├── tofire6.png │ │ ├── tofire7.png │ │ └── tofire8.png │ └── structureComponent │ │ ├── coinIcon.png │ │ ├── dragonIcon.png │ │ ├── lavaIcon1.png │ │ ├── lavaIcon2.png │ │ ├── lavaIcon3.png │ │ ├── lavaIcon4.png │ │ ├── monsterIcon.png │ │ ├── playerIcon.png │ │ └── wallIcon.png ├── router.js ├── store.js └── views │ ├── Home.vue │ ├── entireGame.vue │ ├── gameDesign.vue │ ├── help.vue │ ├── playerFigure.vue │ ├── previewPage.vue │ └── startUpAndEndDesign.vue ├── tests ├── gameClass │ ├── game.html │ ├── gameClass.js │ ├── img │ │ ├── coinIcon1.png │ │ ├── lavaIcon1.png │ │ ├── player.png │ │ ├── playerIcon1.png │ │ ├── sprites.png │ │ └── wallIcon1.png │ ├── pic │ │ ├── Monster1.png │ │ ├── Monster2.png │ │ ├── Monster3.png │ │ ├── Monster4.png │ │ ├── dragon1.png │ │ ├── dragon10.png │ │ ├── dragon2.png │ │ ├── dragon3.png │ │ ├── dragon4.png │ │ ├── dragon5.png │ │ ├── dragon6.png │ │ ├── dragon7.png │ │ ├── dragon8.png │ │ ├── dragon9.png │ │ ├── fire1.png │ │ ├── fire2.png │ │ ├── fire3.png │ │ ├── fire4.png │ │ ├── rose.png │ │ ├── tofire1.png │ │ ├── tofire2.png │ │ ├── tofire3.png │ │ ├── tofire4.png │ │ ├── tofire5.png │ │ ├── tofire6.png │ │ ├── tofire7.png │ │ └── tofire8.png │ └── test.js ├── test.html └── unit │ ├── .eslintrc.js │ ├── example.spec.js │ └── pureGameTest.spec.js └── vue.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | 23 | /src/video -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DIYGame 2 | DIYGame是一个纯前端的应用。使用者可以在**不写任何一行代码**的情况下DIY一款冒险游戏。最终设计的游戏以html文件的形式下载下来,可以在浏览器上运行。 3 | 4 | ## 主页 5 | 6 | [DIYGAME主页介绍](http://diygame.vip/#/) 7 | 8 | ## 设计示例 9 | 10 | ### 示例1:游戏角色形象设计 11 | 12 | [GIF动画演示](./README/playerFigure.md) 13 | 14 | ![alt 加载失败](./README/playerFigureExp.png) 15 | 16 | 17 | ### 示例2:游戏关卡设计 18 | 19 | [GIF动画演示](./README/structureDesign.md) 20 | 21 | ![alt 加载失败](./README/gamePanelExample.png) 22 | 23 | ### 示例3:游戏的开始与结束界面设计 24 | 25 | ![alt 加载失败](./README/startFace.png) 26 | 27 | ## 简单的设计实例 28 | 29 | 用DIYGAME来设计的[一个简单的游戏实例](http://diygame.vip/#/previewPage) 30 | 31 | ## 马上试一试: 32 | 33 | 以上都只是可设计范围的冰山一角,想要了解全部内容,建议马上尝试:[DIYGAME设计总台](http://diygame.vip/#/entireGame)。 34 | 请用电脑端来访问。 35 | 36 | ## 使用指南 37 | 38 | [DIYGAME帮助](http://diygame.vip/#/help) 39 | 40 | ## 技术栈 41 | 42 | - vue 43 | - vuex 44 | - vueRouter 45 | - vue-cli 46 | - sass 47 | 48 | ## 其他 49 | 50 | 如果喜欢该作品,希望给个star✨,感谢🙏 51 | -------------------------------------------------------------------------------- /README.textClipping: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README.textClipping -------------------------------------------------------------------------------- /README/XTFpicture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/XTFpicture.png -------------------------------------------------------------------------------- /README/gamePanelExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/gamePanelExample.png -------------------------------------------------------------------------------- /README/gamePanelExample_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/gamePanelExample_en.png -------------------------------------------------------------------------------- /README/playerFigure.md: -------------------------------------------------------------------------------- 1 | 2 | ## GIF demo: Design player character 3 | 4 | ![alt failure load](./playerFigureGIF.gif) 5 | 6 | 7 | [<- back](../README.md) -------------------------------------------------------------------------------- /README/playerFigureExp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/playerFigureExp.png -------------------------------------------------------------------------------- /README/playerFigureGIF.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/playerFigureGIF.gif -------------------------------------------------------------------------------- /README/startFace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/startFace.png -------------------------------------------------------------------------------- /README/startFace_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/startFace_en.png -------------------------------------------------------------------------------- /README/structureDesign.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/README/structureDesign.gif -------------------------------------------------------------------------------- /README/structureDesign.md: -------------------------------------------------------------------------------- 1 | 2 | ## GIF demo: Design game level 3 | 4 | ![alt 加载失败](./structureDesign.gif) 5 | 6 | 7 | [<- back](../README.md) -------------------------------------------------------------------------------- /README_ch.md: -------------------------------------------------------------------------------- 1 | 2 | [English](./README.md) 3 | 4 | # DIYGame 5 | DIYGame是一个纯前端的应用。使用者可以在**不写任何一行代码**的情况下DIY一款冒险游戏。最终设计的游戏以html文件的形式下载下来,可以在浏览器上运行。 6 | 7 | ## 主页 8 | 9 | [DIYGAME主页介绍](http://diygame.vip/#/) 10 | 11 | ## 设计示例 12 | 13 | ### 示例1:游戏角色形象设计 14 | 15 | [GIF动画演示](./README/playerFigure.md) 16 | 17 | ![alt 加载失败](./README/playerFigureExp.png) 18 | 19 | 20 | ### 示例2:游戏关卡设计 21 | 22 | [GIF动画演示](./README/structureDesign.md) 23 | 24 | ![alt 加载失败](./README/gamePanelExample.png) 25 | 26 | ### 示例3:游戏的开始与结束界面设计 27 | 28 | ![alt 加载失败](./README/startFace.png) 29 | 30 | ## 简单的设计实例 31 | 32 | 用DIYGAME来设计的[一个简单的游戏实例](http://diygame.vip/#/previewPage) 33 | 34 | ## 马上试一试: 35 | 36 | 以上都只是可设计范围的冰山一角,想要了解全部内容,建议马上尝试:[DIYGAME设计总台](http://diygame.vip/#/entireGame)。 37 | 请用电脑端来访问。 38 | 39 | ## 使用指南 40 | 41 | [DIYGAME帮助](http://diygame.vip/#/help) 42 | 43 | ## 技术栈 44 | 45 | - vue 46 | - vuex 47 | - vueRouter 48 | - vue-cli 49 | - sass 50 | 51 | ## 其他 52 | 53 | 如果喜欢该作品,希望给个star✨,感谢🙏 54 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "diygame", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "test:unit": "vue-cli-service test:unit" 10 | }, 11 | "dependencies": { 12 | "@fortawesome/fontawesome-svg-core": "^1.2.17", 13 | "@fortawesome/free-solid-svg-icons": "^5.8.1", 14 | "@fortawesome/vue-fontawesome": "^0.1.6", 15 | "core-js": "^2.6.5", 16 | "mobile-detect": "^1.4.3", 17 | "vue": "^2.6.10", 18 | "vue-router": "^3.0.3", 19 | "vuex": "^3.0.1" 20 | }, 21 | "devDependencies": { 22 | "@vue/cli-plugin-babel": "^3.6.0", 23 | "@vue/cli-plugin-eslint": "^3.6.0", 24 | "@vue/cli-plugin-unit-jest": "^3.6.0", 25 | "@vue/cli-service": "^3.6.0", 26 | "@vue/test-utils": "1.0.0-beta.29", 27 | "babel-core": "7.0.0-bridge.0", 28 | "babel-eslint": "^10.0.1", 29 | "babel-jest": "^23.6.0", 30 | "eslint": "^5.16.0", 31 | "eslint-plugin-vue": "^5.0.0", 32 | "sass": "^1.18.0", 33 | "sass-loader": "^7.1.0", 34 | "vue-template-compiler": "^2.5.21" 35 | }, 36 | "eslintConfig": { 37 | "root": true, 38 | "env": { 39 | "node": true 40 | }, 41 | "extends": [ 42 | "plugin:vue/essential", 43 | "eslint:recommended" 44 | ], 45 | "rules": {}, 46 | "parserOptions": { 47 | "parser": "babel-eslint" 48 | } 49 | }, 50 | "postcss": { 51 | "plugins": { 52 | "autoprefixer": {} 53 | } 54 | }, 55 | "browserslist": [ 56 | "> 1%", 57 | "last 2 versions", 58 | "not ie <= 8" 59 | ], 60 | "jest": { 61 | "moduleFileExtensions": [ 62 | "js", 63 | "jsx", 64 | "json", 65 | "vue" 66 | ], 67 | "transform": { 68 | "^.+\\.vue$": "vue-jest", 69 | ".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub", 70 | "^.+\\.jsx?$": "babel-jest" 71 | }, 72 | "transformIgnorePatterns": [ 73 | "/node_modules/" 74 | ], 75 | "moduleNameMapper": { 76 | "^@/(.*)$": "/src/$1" 77 | }, 78 | "snapshotSerializers": [ 79 | "jest-serializer-vue" 80 | ], 81 | "testMatch": [ 82 | "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)" 83 | ], 84 | "testURL": "http://localhost/", 85 | "watchPlugins": [ 86 | "jest-watch-typeahead/filename", 87 | "jest-watch-typeahead/testname" 88 | ] 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | diygame 10 | 11 | 12 | 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/nprogress.css: -------------------------------------------------------------------------------- 1 | /* Make clicks pass-through */ 2 | #nprogress { 3 | /* pointer-events: none; */ 4 | position:fixed; 5 | top:0; 6 | left:0; 7 | background-color:rgba(0, 0, 0, 0.6); 8 | width:100%; 9 | height:100%; 10 | z-index:1000; 11 | } 12 | 13 | #nprogress .bar { 14 | background: #29d; 15 | position: fixed; 16 | z-index: 1031; 17 | top: 0; 18 | left: 0; 19 | 20 | width: 100%; 21 | height: 2px; 22 | } 23 | 24 | /* Fancy blur effect */ 25 | #nprogress .peg { 26 | display: block; 27 | position: absolute; 28 | right: 0px; 29 | width: 100px; 30 | height: 100%; 31 | box-shadow: 0 0 10px #29d, 0 0 5px #29d; 32 | opacity: 1.0; 33 | 34 | -webkit-transform: rotate(3deg) translate(0px, -4px); 35 | -ms-transform: rotate(3deg) translate(0px, -4px); 36 | transform: rotate(3deg) translate(0px, -4px); 37 | } 38 | 39 | /* Remove these to get rid of the spinner */ 40 | #nprogress .spinner { 41 | display: block; 42 | position: fixed; 43 | z-index: 1031; 44 | top: 50%; 45 | right: 50%; 46 | } 47 | 48 | #nprogress .spinner-icon { 49 | width: 18px; 50 | height: 18px; 51 | box-sizing: border-box; 52 | 53 | border: solid 2px transparent; 54 | border-top-color: #29d; 55 | border-left-color: #29d; 56 | border-radius: 50%; 57 | 58 | -webkit-animation: nprogress-spinner 400ms linear infinite; 59 | animation: nprogress-spinner 400ms linear infinite; 60 | } 61 | 62 | .nprogress-custom-parent { 63 | overflow: hidden; 64 | position: relative; 65 | } 66 | 67 | .nprogress-custom-parent #nprogress .spinner, 68 | .nprogress-custom-parent #nprogress .bar { 69 | position: absolute; 70 | } 71 | 72 | @-webkit-keyframes nprogress-spinner { 73 | 0% { -webkit-transform: rotate(0deg); } 74 | 100% { -webkit-transform: rotate(360deg); } 75 | } 76 | @keyframes nprogress-spinner { 77 | 0% { transform: rotate(0deg); } 78 | 100% { transform: rotate(360deg); } 79 | } 80 | -------------------------------------------------------------------------------- /public/nprogress.js: -------------------------------------------------------------------------------- 1 | /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress 2 | * @license MIT */ 3 | 4 | ; (function (root, factory) { 5 | 6 | if (typeof define === 'function' && define.amd) { 7 | define(factory); 8 | } else if (typeof exports === 'object') { 9 | module.exports = factory(); 10 | } else { 11 | root.NProgress = factory(); 12 | } 13 | 14 | })(this, function () { 15 | var NProgress = {}; 16 | 17 | NProgress.version = '0.2.0'; 18 | 19 | var Settings = NProgress.settings = { 20 | minimum: 0.08, 21 | easing: 'ease', 22 | positionUsing: '', 23 | speed: 200, 24 | trickle: true, 25 | trickleRate: 0.02, 26 | trickleSpeed: 800, 27 | showSpinner: true, 28 | barSelector: '[role="bar"]', 29 | spinnerSelector: '[role="spinner"]', 30 | parent: 'body', 31 | template: '
' 32 | }; 33 | 34 | /** 35 | * Updates configuration. 36 | * 37 | * NProgress.configure({ 38 | * minimum: 0.1 39 | * }); 40 | */ 41 | NProgress.configure = function (options) { 42 | var key, value; 43 | for (key in options) { 44 | value = options[key]; 45 | if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; 46 | } 47 | 48 | return this; 49 | }; 50 | 51 | /** 52 | * Last number. 53 | */ 54 | 55 | NProgress.status = null; 56 | 57 | /** 58 | * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. 59 | * 60 | * NProgress.set(0.4); 61 | * NProgress.set(1.0); 62 | */ 63 | 64 | NProgress.set = function (n) { 65 | var started = NProgress.isStarted(); 66 | 67 | n = clamp(n, Settings.minimum, 1); 68 | NProgress.status = (n === 1 ? null : n); 69 | 70 | var progress = NProgress.render(!started), 71 | bar = progress.querySelector(Settings.barSelector), 72 | speed = Settings.speed, 73 | ease = Settings.easing; 74 | 75 | progress.offsetWidth; /* Repaint */ 76 | 77 | queue(function (next) { 78 | // Set positionUsing if it hasn't already been set 79 | if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); 80 | 81 | // Add transition 82 | css(bar, barPositionCSS(n, speed, ease)); 83 | 84 | if (n === 1) { 85 | // Fade out 86 | css(progress, { 87 | transition: 'none', 88 | opacity: 1 89 | }); 90 | progress.offsetWidth; /* Repaint */ 91 | 92 | setTimeout(function () { 93 | css(progress, { 94 | transition: 'all ' + speed + 'ms linear', 95 | opacity: 0 96 | }); 97 | setTimeout(function () { 98 | NProgress.remove(); 99 | next(); 100 | }, speed); 101 | }, speed); 102 | } else { 103 | setTimeout(next, speed); 104 | } 105 | }); 106 | 107 | return this; 108 | }; 109 | 110 | NProgress.isStarted = function () { 111 | return typeof NProgress.status === 'number'; 112 | }; 113 | 114 | /** 115 | * Shows the progress bar. 116 | * This is the same as setting the status to 0%, except that it doesn't go backwards. 117 | * 118 | * NProgress.start(); 119 | * 120 | */ 121 | NProgress.start = function () { 122 | if (!NProgress.status) NProgress.set(0); 123 | 124 | var work = function () { 125 | setTimeout(function () { 126 | if (!NProgress.status) return; 127 | NProgress.trickle(); 128 | work(); 129 | }, Settings.trickleSpeed); 130 | }; 131 | 132 | if (Settings.trickle) work(); 133 | 134 | return this; 135 | }; 136 | 137 | /** 138 | * Hides the progress bar. 139 | * This is the *sort of* the same as setting the status to 100%, with the 140 | * difference being `done()` makes some placebo effect of some realistic motion. 141 | * 142 | * NProgress.done(); 143 | * 144 | * If `true` is passed, it will show the progress bar even if its hidden. 145 | * 146 | * NProgress.done(true); 147 | */ 148 | 149 | NProgress.done = function (force) { 150 | if (!force && !NProgress.status) return this; 151 | 152 | return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); 153 | }; 154 | 155 | /** 156 | * Increments by a random amount. 157 | */ 158 | 159 | NProgress.inc = function (amount) { 160 | var n = NProgress.status; 161 | 162 | if (!n) { 163 | return NProgress.start(); 164 | } else { 165 | if (typeof amount !== 'number') { 166 | amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); 167 | } 168 | 169 | n = clamp(n + amount, 0, 0.994); 170 | return NProgress.set(n); 171 | } 172 | }; 173 | 174 | NProgress.trickle = function () { 175 | return NProgress.inc(Math.random() * Settings.trickleRate); 176 | }; 177 | 178 | /** 179 | * Waits for all supplied jQuery promises and 180 | * increases the progress as the promises resolve. 181 | * 182 | * @param $promise jQUery Promise 183 | */ 184 | (function () { 185 | var initial = 0, current = 0; 186 | 187 | NProgress.promise = function ($promise) { 188 | if (!$promise || $promise.state() === "resolved") { 189 | return this; 190 | } 191 | 192 | if (current === 0) { 193 | NProgress.start(); 194 | } 195 | 196 | initial++; 197 | current++; 198 | 199 | $promise.always(function () { 200 | current--; 201 | if (current === 0) { 202 | initial = 0; 203 | NProgress.done(); 204 | } else { 205 | NProgress.set((initial - current) / initial); 206 | } 207 | }); 208 | 209 | return this; 210 | }; 211 | 212 | })(); 213 | 214 | /** 215 | * (Internal) renders the progress bar markup based on the `template` 216 | * setting. 217 | */ 218 | 219 | NProgress.render = function (fromStart) { 220 | if (NProgress.isRendered()) return document.getElementById('nprogress'); 221 | 222 | addClass(document.documentElement, 'nprogress-busy'); 223 | 224 | var progress = document.createElement('div'); 225 | progress.id = 'nprogress'; 226 | progress.innerHTML = Settings.template; 227 | 228 | var bar = progress.querySelector(Settings.barSelector), 229 | perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), 230 | parent = document.querySelector(Settings.parent), 231 | spinner; 232 | 233 | css(bar, { 234 | transition: 'all 0 linear', 235 | transform: 'translate3d(' + perc + '%,0,0)' 236 | }); 237 | 238 | if (!Settings.showSpinner) { 239 | spinner = progress.querySelector(Settings.spinnerSelector); 240 | spinner && removeElement(spinner); 241 | } 242 | 243 | if (parent != document.body) { 244 | addClass(parent, 'nprogress-custom-parent'); 245 | } 246 | 247 | parent.appendChild(progress); 248 | return progress; 249 | }; 250 | 251 | /** 252 | * Removes the element. Opposite of render(). 253 | */ 254 | 255 | NProgress.remove = function () { 256 | removeClass(document.documentElement, 'nprogress-busy'); 257 | removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent'); 258 | var progress = document.getElementById('nprogress'); 259 | progress && removeElement(progress); 260 | }; 261 | 262 | /** 263 | * Checks if the progress bar is rendered. 264 | */ 265 | 266 | NProgress.isRendered = function () { 267 | return !!document.getElementById('nprogress'); 268 | }; 269 | 270 | /** 271 | * Determine which positioning CSS rule to use. 272 | */ 273 | 274 | NProgress.getPositioningCSS = function () { 275 | // Sniff on document.body.style 276 | var bodyStyle = document.body.style; 277 | 278 | // Sniff prefixes 279 | var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : 280 | ('MozTransform' in bodyStyle) ? 'Moz' : 281 | ('msTransform' in bodyStyle) ? 'ms' : 282 | ('OTransform' in bodyStyle) ? 'O' : ''; 283 | 284 | if (vendorPrefix + 'Perspective' in bodyStyle) { 285 | // Modern browsers with 3D support, e.g. Webkit, IE10 286 | return 'translate3d'; 287 | } else if (vendorPrefix + 'Transform' in bodyStyle) { 288 | // Browsers without 3D support, e.g. IE9 289 | return 'translate'; 290 | } else { 291 | // Browsers without translate() support, e.g. IE7-8 292 | return 'margin'; 293 | } 294 | }; 295 | 296 | /** 297 | * Helpers 298 | */ 299 | 300 | function clamp(n, min, max) { 301 | if (n < min) return min; 302 | if (n > max) return max; 303 | return n; 304 | } 305 | 306 | /** 307 | * (Internal) converts a percentage (`0..1`) to a bar translateX 308 | * percentage (`-100%..0%`). 309 | */ 310 | 311 | function toBarPerc(n) { 312 | return (-1 + n) * 100; 313 | } 314 | 315 | 316 | /** 317 | * (Internal) returns the correct CSS for changing the bar's 318 | * position given an n percentage, and speed and ease from Settings 319 | */ 320 | 321 | function barPositionCSS(n, speed, ease) { 322 | var barCSS; 323 | 324 | if (Settings.positionUsing === 'translate3d') { 325 | barCSS = { transform: 'translate3d(' + toBarPerc(n) + '%,0,0)' }; 326 | } else if (Settings.positionUsing === 'translate') { 327 | barCSS = { transform: 'translate(' + toBarPerc(n) + '%,0)' }; 328 | } else { 329 | barCSS = { 'margin-left': toBarPerc(n) + '%' }; 330 | } 331 | 332 | barCSS.transition = 'all ' + speed + 'ms ' + ease; 333 | 334 | return barCSS; 335 | } 336 | 337 | /** 338 | * (Internal) Queues a function to be executed. 339 | */ 340 | 341 | var queue = (function () { 342 | var pending = []; 343 | 344 | function next() { 345 | var fn = pending.shift(); 346 | if (fn) { 347 | fn(next); 348 | } 349 | } 350 | 351 | return function (fn) { 352 | pending.push(fn); 353 | if (pending.length == 1) next(); 354 | }; 355 | })(); 356 | 357 | /** 358 | * (Internal) Applies css properties to an element, similar to the jQuery 359 | * css method. 360 | * 361 | * While this helper does assist with vendor prefixed property names, it 362 | * does not perform any manipulation of values prior to setting styles. 363 | */ 364 | 365 | var css = (function () { 366 | var cssPrefixes = ['Webkit', 'O', 'Moz', 'ms'], 367 | cssProps = {}; 368 | 369 | function camelCase(string) { 370 | return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function (match, letter) { 371 | return letter.toUpperCase(); 372 | }); 373 | } 374 | 375 | function getVendorProp(name) { 376 | var style = document.body.style; 377 | if (name in style) return name; 378 | 379 | var i = cssPrefixes.length, 380 | capName = name.charAt(0).toUpperCase() + name.slice(1), 381 | vendorName; 382 | while (i--) { 383 | vendorName = cssPrefixes[i] + capName; 384 | if (vendorName in style) return vendorName; 385 | } 386 | 387 | return name; 388 | } 389 | 390 | function getStyleProp(name) { 391 | name = camelCase(name); 392 | return cssProps[name] || (cssProps[name] = getVendorProp(name)); 393 | } 394 | 395 | function applyCss(element, prop, value) { 396 | prop = getStyleProp(prop); 397 | element.style[prop] = value; 398 | } 399 | 400 | return function (element, properties) { 401 | var args = arguments, 402 | prop, 403 | value; 404 | 405 | if (args.length == 2) { 406 | for (prop in properties) { 407 | value = properties[prop]; 408 | if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); 409 | } 410 | } else { 411 | applyCss(element, args[1], args[2]); 412 | } 413 | } 414 | })(); 415 | 416 | /** 417 | * (Internal) Determines if an element or space separated list of class names contains a class name. 418 | */ 419 | 420 | function hasClass(element, name) { 421 | var list = typeof element == 'string' ? element : classList(element); 422 | return list.indexOf(' ' + name + ' ') >= 0; 423 | } 424 | 425 | /** 426 | * (Internal) Adds a class to an element. 427 | */ 428 | 429 | function addClass(element, name) { 430 | var oldList = classList(element), 431 | newList = oldList + name; 432 | 433 | if (hasClass(oldList, name)) return; 434 | 435 | // Trim the opening space. 436 | element.className = newList.substring(1); 437 | } 438 | 439 | /** 440 | * (Internal) Removes a class from an element. 441 | */ 442 | 443 | function removeClass(element, name) { 444 | var oldList = classList(element), 445 | newList; 446 | 447 | if (!hasClass(element, name)) return; 448 | 449 | // Replace the class name. 450 | newList = oldList.replace(' ' + name + ' ', ' '); 451 | 452 | // Trim the opening and closing spaces. 453 | element.className = newList.substring(1, newList.length - 1); 454 | } 455 | 456 | /** 457 | * (Internal) Gets a space separated list of the class names on the element. 458 | * The list is wrapped with a single space on each end to facilitate finding 459 | * matches within the list. 460 | */ 461 | 462 | function classList(element) { 463 | return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); 464 | } 465 | 466 | /** 467 | * (Internal) Removes an element from the DOM. 468 | */ 469 | 470 | function removeElement(element) { 471 | element && element.parentNode && element.parentNode.removeChild(element); 472 | } 473 | 474 | return NProgress; 475 | }); 476 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 45 | 140 | -------------------------------------------------------------------------------- /src/components/gameDesign/lib/transversion.js: -------------------------------------------------------------------------------- 1 | 2 | export function stringToArray(string) { 3 | if (typeof string != 'string') throw new Error('argument not a string on stringToArray: ' + string) 4 | return string.trim().split("\n").map(l => { 5 | l = l.trim(); 6 | return [...l] 7 | }); 8 | } 9 | 10 | export function arrayToString(array) { 11 | if (typeof array != 'object') throw new Error('argument not an array on arrayToString: ' + array) 12 | return array.map(row => row.join('')).join('\n') 13 | } 14 | 15 | export function stringToMap(source, context) { 16 | if (typeof source != 'string') throw new Error('argument not a string on stringToMap: ' + source) 17 | return source.trim().split("\n").map(row => { 18 | return row.trim().split("").map(grid => { 19 | let fileName = ""; 20 | if (grid == 'o') { 21 | fileName = 'coinIcon' 22 | } else if (grid == '#') { 23 | fileName = 'wallIcon' 24 | } else if (grid == '+') { 25 | fileName = 'lavaIcon1' 26 | } else if (grid == '@') { 27 | fileName = 'playerIcon' 28 | } else if (grid == 'm') { 29 | fileName = 'monsterIcon' 30 | } else if (grid == 'd') { 31 | fileName = 'dragonIcon' 32 | } else if (grid == '=') { 33 | fileName = 'lavaIcon2' 34 | } else if (grid == '|') { 35 | fileName = 'lavaIcon3' 36 | } else if (grid == 'v') { 37 | fileName = 'lavaIcon4' 38 | } 39 | 40 | if (fileName.length == 0) { 41 | return { backgroundImage: "", pattern: '.' } 42 | } else { 43 | let src = context[fileName] 44 | if (src == undefined) throw new Error('can not found the image on pics: ' + fileName) 45 | return { 46 | backgroundImage: `url(${src})`, 47 | pattern: grid 48 | } 49 | } 50 | }) 51 | }) 52 | } 53 | 54 | export function mapToString(map) { 55 | if (typeof map != 'object') throw new Error('map is not an object on mapToString', + map) 56 | return map.map(row => row.map(each => { return each.pattern }).join('')).join('\n') 57 | } 58 | -------------------------------------------------------------------------------- /src/components/gameDesign/structureDesign.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 310 | 311 | 527 | 528 | -------------------------------------------------------------------------------- /src/components/helpPage/helpForEntireGame.vue: -------------------------------------------------------------------------------- 1 | 152 | 153 | 163 | 164 | -------------------------------------------------------------------------------- /src/components/helpPage/helpForFaceDesign.vue: -------------------------------------------------------------------------------- 1 | 87 | 88 | 98 | 99 | -------------------------------------------------------------------------------- /src/components/helpPage/helpForGameDesign.vue: -------------------------------------------------------------------------------- 1 | 200 | 201 | 211 | 212 | 226 | -------------------------------------------------------------------------------- /src/components/helpPage/helpForPlayerFigure.vue: -------------------------------------------------------------------------------- 1 | 180 | 181 | 191 | 192 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /src/components/helpPage/lib/_cssStyle.scss: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}html{font-size:87.5%;line-height:1.57143em}html{font-size:14px;line-height:1.6em;-webkit-text-size-adjust:100%}body{background:#fcfcfc;color:#545454;text-rendering:optimizeLegibility;font-family:"AvenirNext-Regular"}a{color:#de4c4f;text-decoration:none}h1{font-family:"AvenirNext-Medium";color:#333;font-size:1.6em;line-height:1.3em;margin-bottom:.78571em}h2{font-family:"AvenirNext-Medium";color:#333;font-size:1.3em;line-height:1em;margin-bottom:.62857em}h3{font-family:"AvenirNext-Medium";color:#333;font-size:1.15em;line-height:1em;margin-bottom:.47143em}p{margin-bottom:1.57143em;hyphens:auto}hr{height:1px;border:0;background-color:#dedede;margin:-1px auto 1.57143em auto}ul,ol{margin-bottom:.31429em}ul ul,ul ol,ol ul,ol ol{margin-bottom:0px}ol li:before{content:counter(ol) ".";counter-increment:ol;color:#e06e73;text-align:right;display:inline-block;min-width:1em;margin-right:0.5em}b,strong{font-family:"AvenirNext-Bold"}i,em{font-family:"AvenirNext-Italic"}code{font-family:"Menlo-Regular"}.text-overflow-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sf_code_string,.sf_code_selector,.sf_code_attr-name,.sf_code_char,.sf_code_builtin,.sf_code_inserted{color:#D33905}.sf_code_comment,.sf_code_prolog,.sf_code_doctype,.sf_code_cdata{color:#838383}.sf_code_number,.sf_code_boolean{color:#0E73A2}.sf_code_keyword,.sf_code_atrule,.sf_code_rule,.sf_code_attr-value,.sf_code_function,.sf_code_class-name,.sf_code_class,.sf_code_regex,.sf_code_important,.sf_code_variable,.sf_code_interpolation{color:#0E73A2}.sf_code_property,.sf_code_tag,.sf_code_constant,.sf_code_symbol,.sf_code_deleted{color:#1B00CE}.sf_code_macro,.sf_code_entity,.sf_code_operator,.sf_code_url{color:#920448}.note-wrapper{max-width:46em;margin:0px auto;padding:1.57143em 3.14286em}.note-wrapper.spotlight-preview{overflow-x:hidden}u{text-decoration:none;background-image:linear-gradient(to bottom, rgba(0,0,0,0) 50%,#e06e73 50%);background-repeat:repeat-x;background-size:2px 2px;background-position:0 1.05em}s{color:#878787}p{margin-bottom:0.1em}hr{margin-bottom:0.7em;margin-top:0.7em}ul li{text-indent:-0.35em}ul li:before{content:"•";color:#e06e73;display:inline-block;margin-right:0.3em}ul ul{margin-left:1.25714em}ol li{text-indent:-1.45em}ol ol{margin-left:1.25714em}blockquote{display:block;margin-left:-1em;padding-left:0.8em;border-left:0.2em solid #e06e73}.todo-list ul{margin-left:1.88571em}.todo-list li{text-indent:-1.75em}.todo-list li:before{content:"";display:static;margin-right:0px}.todo-checkbox{text-indent:-1.7em}.todo-checkbox svg{margin-right:0.3em;position:relative;top:0.2em}.todo-checkbox svg #check{display:none}.todo-checkbox.todo-checked #check{display:inline}.todo-checkbox.todo-checked+.todo-text{text-decoration:line-through;color:#878787}.code-inline{display:inline;background:white;border:solid 1px #dedede;padding:0.2em 0.5em;font-size:0.9em}.code-multiline{display:block;background:white;border:solid 1px #dedede;padding:0.7em 1em;font-size:0.9em;overflow-x:auto}.hashtag{display:inline-block;color:white;background:#b8bfc2;padding:0.0em 0.5em;border-radius:1em;text-indent:0}.hashtag a{color:#fff}.address a{color:#545454;background-image:linear-gradient(to bottom, rgba(0,0,0,0) 50%,#0da35e 50%);background-repeat:repeat-x;background-size:2px 2px;background-position:0 1.05em}.address svg{position:relative;top:0.2em;display:inline-block;margin-right:0.2em}.color-preview{display:inline-block;width:1em;height:1em;border:solid 1px rgba(0,0,0,0.3);border-radius:50%;margin-right:0.1em;position:relative;top:0.2em;white-space:nowrap}.color-code{margin-right:0.2em;font-family:"Menlo-Regular";font-size:0.9em}.color-hash{opacity:0.4}.ordered-list-number{color:#e06e73;text-align:right;display:inline-block;min-width:1em}.arrow svg{position:relative;top:0.08em;display:inline-block;margin-right:0.15em;margin-left:0.15em}.arrow svg #rod{stroke:#545454}.arrow svg #point{fill:#545454}mark{color:inherit;display:inline;padding:0.2em 0.5em;background-color:#fcffc0}img{max-width:100%;height:auto} 2 | -------------------------------------------------------------------------------- /src/components/playerFigure/PictureCombine.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | 251 | 252 | -------------------------------------------------------------------------------- /src/components/playerFigure/lib/eraseCanvasTool.js: -------------------------------------------------------------------------------- 1 | //输入:x,y(圆心),radius,dataImage 2 | //输出:返回一个dataImage 3 | 4 | export function eraseCanvas(x,y,radius,dataImage){ 5 | let oneFourthPixelsGroup = getOneFourthPixelsGroup(radius); 6 | let removingPixels = []; 7 | let boundary = { 8 | width: dataImage.width, 9 | height: dataImage.height 10 | } 11 | for (let i = 0;i { 23 | if (p == null) return; 24 | if (!removingPixels.includes(p)) { 25 | removingPixels.push(p) 26 | } 27 | }) 28 | } 29 | } 30 | for (let i = 0; i < removingPixels.length; i++) { 31 | dataImage.data[removingPixels[i] * 4] = 255; 32 | dataImage.data[removingPixels[i] * 4 + 1] = 255; 33 | dataImage.data[removingPixels[i] * 4 + 2] = 255; 34 | dataImage.data[removingPixels[i] * 4 + 3] = 0; 35 | } 36 | return dataImage 37 | } 38 | 39 | function getOneFourthPixelsGroup(radius) { 40 | //获得像素点的结构数组。 41 | //因为橡皮擦是圆形,为了使得擦出的是圆形,就要知道在这个圆里每一行要擦掉多少个像素。 42 | //这个函数利用勾股定理,获得1/4圆部分每行要擦拭多少像素 43 | let row = []; 44 | for (let i = 0; i < radius; i++) { 45 | let pixels1 = Math.sqrt(radius * radius - i * i) 46 | let pixels2 = Math.sqrt(radius * radius - (i + 1) * (i + 1)) 47 | let pixels = Math.round((pixels1 + pixels2) / 2) 48 | row.push(pixels) 49 | } 50 | return row; 51 | } 52 | 53 | function pixelsToPosition(widthDiff, heightDiff, limit) { 54 | //根据位置与canvasX、Y方向上的差距算出像素点在数组里的位置。 55 | if (widthDiff > limit.width || widthDiff < 0 || heightDiff > limit.height || heightDiff < 0) return null; 56 | return limit.width * heightDiff + widthDiff; 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/components/playerFigure/lib/imgSource.js: -------------------------------------------------------------------------------- 1 | //由于直接引用的img不能在canvas里不能toDataURL(); 2 | //所以在这里把两个必要结合的身体图放出来,以便结合。 3 | 4 | const oneBodySrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAA8CAYAAAAgwDn8AAACEElEQVRoQ+2YP0vDUBTFWydxKR3cjYjQrXV2E6GCOjj6BSoO4uji5Oygk/0CTuIggqL4FWwXKTg0OjuULsVJJRcOmIfPl+akNC/cLK9Jc2/eOb93b/6US55vZc/nX1IB0yaoBJQA6YAuIdJAOlwJ0BaSCZQAaSAdrgRoC8kESoA0kA5XArSFZAIlQBpIhysB2kIygRIgDaTDlQBtIZlgYgTuWmvf0dyam/VSeet0YtfJPHEQBDLx7bkv8fZmNCMj9s9e3jO9ZqbJoom6BDRXl0TQRvspk2vTSTBhLOX2/IL8XD9ekfHw6CpG4veSD8OQvj6dwFsBmDgctzUTkHg8eZZTWh9vMmbhfpQnNQFvBZgT77wOY+ZfVAeybyMDAghiSYxNoHACTEf3BlUxt7Fc+bMsckfAGwG2pYM173IeOCAY5yM+bS0kroHCCDCdg7M4jn1XDUyNgHcCsHT65zuxrrJ4cB3bT0rArAX2fuCsgcIJuL/timnRi0q0gUStvmt7HPr3eK97ST0bjU2gMAL2H/oxZ00CYdiT/z+HHRlnKw0Zg6AWi5saAW8EwC7zxQV3ThwHAdN523nIO3EChRFgayUmAZujOA+1gNpI+wyE+Ti7kKs3eivAdBRCbc7mjkDhBLjWdO4JeCNg3KVjtmF0IVfNuJpH6i7krQDbhyx8F3K92yLefHdOGm8jkvg+kFcBP4CLukzprsMQAAAAAElFTkSuQmCC"; 5 | 6 | const headLessBodyGroupSrc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAA8CAYAAAC+X2l1AAAMUklEQVR4Xu1dPYhdVRDeWIlNSGFtNogggiTWNiKGBNTCRhAEu4iFsbSxshMstBDTWQmCWIigKBJsLUwQJJAiG+sUIY2IhSvv3Yy779s3b2bOPefMebvfNtnNO/eeOd/8fDNzzr3v1A5/iAARIAJEgAgQge4InOo+IyckAkSACBABIkAEdkjANAIiQASIABEgAgkIkIATQOeURIAIEAEiQARIwLQBIkAEiAARIAIJCJCAE0DnlESACBABIkAESMC0ASJABIgAESACCQiQgBNA55REgAgQASJABEjAtAEiQASIABEgAgkIkIATQOeURIAIEAEiQARIwLQBIkAEiAARIAIJCJCAE0DnlESACBABIkAESMC0ASJABIgAESACCQiQgBNA55REgAgQASJABEjAtAEiQASIABEgAgkIkIATQOeURIAIEAEiQARIwLQBIkAEiAARIAIJCJCAE0DnlESACBABIkAESMC0ASJABIgAESACCQiQgBNA55REgAgQASJABEjAtAEiQASIABEgAgkIkIATQOeURIAIEAEiQARIwLQBIkAEiAARIAIJCJCAE0DnlDEEvr/y4v7laz/TVmOwcTQRIAKDI8CgNriCouLt7u7uL6559bF/l5d+8sefW6vjxVpkHd/+9cjO3t7e1q4lqkeOPxkIiL/StsfT99VnnthfxB2Jpy1iKQPaeHqfJRES8GED2iZC3rSOFo4wC/RjdvEi8Fx6/snlqral82DZ/ajrWSc3yTjPoTx2tPCJWl05EvAhXWPF1TLzqWViYjByv2uPn13++tIHzy3/fe/9r5f/ChGP6tzRdSzWNOpaauk24z5aABoVa5HXsvvDWGasBe0bdYvyn3v3m5UhGTJn2F+vOTV9ROyoRgwiAT/UuJX5jFp1RYlrVEeOrqOG8fdy9m2aZ9v84KQQ8LbZ+6JCXMh86eXzO6de+Xg4nqlFwOLbpXF1OGB6BatowC8FuNV6MPBo80glLBn1KOvQ8N+2dbTSb6/7Rv1gFCKw7F/s/qcPf1tCeeXe3eW/vexfw/XG7Qcrqr3w1Om1qkb5L/56fSti9agJXDTeiFI0O9L8M2pfW6HUFsEoGniiwLaQ+fA9rQCEBkQCbq2R7bx/1A96ktgmRC37JwHn2KNFwFl78SeCgLU91IUpjNLCtRxXy3xGyUBRfsmoPz9zfym67GGg+/WuAHB+dIC3759ZDhG58W9Zh8iNf4+WEMl6NwWgUXxgIWvUD0ZJ4Ea3fw1X9FP0D81vZVy2/2p0XpLAyb1a+rCXcLEj4Y2jEq8QF7neu8ZqFbCV+YwSfKKBR1pYJOB5GTUJeKzHwqJ+QAL22T8JePMh0MMokoB3dooJuCTzaQm45R6aY2CFpd1nlAwU1yFySUam7SllyS/yWhmjVQFjRon2l2lb6yrK0U+ha3Y0agcFOwxahyTLfwXPO5++thThozevr3R4NPu1/FargLPtP5rA9dqLRz0IfjK/1Ymw9CFxFO1Mrnv29amzJz/v/Hhn+asWn7oS8CZBLAKd+zkJuO8hFAyYJODpgf7sRKGUyLISOPT7aOKgEdjceKLJRQJeRab3XvyxJWBvT13g7w285lDWnpGV8fRyYCsgzF1H7wAq8n528dzajFD+E4kZ94SlosfMUwLdD9/dXN7KyjQtfKOfe/1h9FPoWucB8ehtP5Y/o99anazW8muBX2vdY2dI61xh/JG/Nb9qneBpcUjk8u6hyvja8qIeJD4sHoda/KA+SvWAcmM8EP1YccldAXsDDgk4Gsp940nAUwUvPyRgn914icwbOGsHzOgqtIBJAt7c6ozibNmNbAGUHmIiAU8IqARsEa739C1mcL0c2CIsrMC8GWgv+dEBrPVolXzrzN9y1GgFjBWvti6pLGX+XoeEkADw1OO2nd621qPpN9sPNP/V9uhay6tVXlgBaWcirLMb2CmK7jW2ImDE2+oo4vjaevHqQfAo1Yclt9zXGkcCfvg4DAm4lotO9yltQZOA6+rBuhsJ2ELI97k38JcGfBJwXT0MS8DaYSXt9JiV8WAF3Kr1YFWMWqYm11kZqLen7zOT+ChNL7jHiKdYW2ec1kqwkyIZoXfvRatocF4r07TktD7HhOL3r6bnrrEC9p7m7uUHVodCex4b/UHsLGvPXQuY2pmBLHk1e58b8C377GX/2HrW8Nfkxac25Pra8lt6KNVHbT47UgGTgFdNRwyGBGyFgPWfk4Cn5yKzWqMk4L6H9KzAX1oBW95Xm8CsggYLsmghholfbfktPQxHwNhCEQG1b+XwVjCYMbQmMu86sKUzegWMBiOHkOT/sTJ5+vwby49u3fxyxZdqG7rmqFaFh/bzywuX18YYkb+13FaAs1rq1pu95P7Zh8e0wGO1/rP23DX7evT0hZWP/n5wY/k3+gXGsd52hHuB8jfKv7v79Mp6evut1/7RzuW6aDxtTcDWetAPJF56r5Nxc+PT/xWwl7iiLUQScFSlm8dreiIB18VZC/zaoTIScFv8MWCSgPvgrSVs2taLjLcKGhLwhJRKwNpeT2kLpddza9phCHwOzMpAMcOxKrpe7mAd9sBMbm6G5l2XZhe4xxOtAERPUuH0rmA0ItYyf2tPbPRKUioxrMAQh1H0oBGxZre95NYOt2EBI3LKOrRKuJfcmr1jZwE7o94KGAuy7LgqesK4ubd3aymaxJ1W+iEBP7QANHwSsJd6p3Ek4AkHEnDMbkpHa4mcBEwScCmyq9d5O6Mk4D33OzUOI6wewtIyk9IKuHcGjXt28jyeN+PEPdSsDNSqwPBzlLt1BamdBbj6z+o7UTGTFLmtvS+twtEqiV56svxglNPbXvvROkK9OihRusBDNng9Viy91qHZxRdnp8N4mh+0rrSi+B745+7+4nc8u4Adxaw91NJ14frQXrAClvG1O4wkYOXwAwnYZ9ok4NVEQ3t1ZnZFhgFHIyxMjHoRl8/aDkaRgKOIlY33bumRgCtVwJaaont4WiVtzTP3c3RQ3PTXMmStQh4lECH+WgXZq6IRefANUIjj0UpsOvVpnfbE9b51d3olpfY9wr0rYOsswWh2g61CqzLDPeFe+Gr+jwmfyK+N7312QNv7RTsReVE+K75qe/Ot9GKdOdEqw157qLV4wuqYoF5q2VW4b20ZiABiBda5wFnXk4BXH9NoFUhJwOtxRj9oFSAtP8DKlwTsRaxsHAl4wo0E7LMfNwFrLZ/RKwCUW9tT1DLUVsTlU8/RUVoFjAmPtXdaOv/RSnbaI5If61tC8HovMXkPedVaFxKXdd9WpyStea3PvVsEWJFZFYE1b+3PvZVvtr9ivNHOKmj+gnYnepDODz7e0+td79a6pAWNxIvrr72HOtfOtILS6kx0r4BJwNMLLbyEMdcwtOtJwKt7rq1eZUcCnir7bEJDPUgFr7Wes+W1iMqbgGpbLyTgupF1eAK2Mk889j96JeDd+8WKYHTitZ6HzJa/lttoAa7W/aMB/2D8mG8ysrYIRH6tAzSKH2itXU3vx83ete/Nzl6n6MU6tNpqD7XU773Eq3UkulXAJODpFXejGLqWQJCAS11x/XWW3eNV1uNUWfZDAq5rF73vlrX14l0nCbjs9LPga34dodbysR5477UHGTUU67nYXhVWqdxYkWjvZs0K+N51jTrOu2fqtf9amXIpXlZLFP1h1IrSuwWWjXepnqzrti0uaWdBrPhr4TD3cyux1vZ+kQdr2RkJeG81g9k2QycBz3XJ1etJwOvxzE7oSMCbDzvW9QL7bqO0cG1JN/s3niUYloDx5duWQ47S8x9FjlqGolVelj6i85/U8d6WrYb36PY2unyW3SERZ1dUlrzH9fOoHUXHt8It2tKPjo/K7a6AScBRaOeN11olJOB5uFpXk4AthHI/JwHn4i+zRwk1Or7VKqOEGh0fldskYLlhtMKKtiiignvHjyKHV140cPyi617P/UXlPS7j525BjG5vo8tn2VHrgGjNf9I/L7Wf0uta4Y12pD3O6B1XKicJGPaAS4GsfZ22F0kCro306v1IwPNOdbbVjv9bt1rLcVLvX0qkpde1wtlLrN5xpXK634QVnUAjELlPLyIZRY4ofqyESxHLvW50extdPq/2WAl7kaozDrdm5K43bj9Y/mq9EEezO+/1dVZxcBdvou0dVyofCfje9HL/aIu9FPDodayEo4jljh+d4EaXz6s9ErAXqTrjSMATjrV54j+6b6APf3n2UgAAAABJRU5ErkJggg==" 7 | 8 | 9 | 10 | function createUntaintImage(src) { 11 | let img = document.createElement("img") 12 | img.src = src; 13 | return img; 14 | } 15 | let oneBodyImg = createUntaintImage(oneBodySrc) 16 | let headLessBodyGroupImg = createUntaintImage(headLessBodyGroupSrc) 17 | 18 | module.exports = { 19 | oneBodyImg, 20 | headLessBodyGroupImg, 21 | } -------------------------------------------------------------------------------- /src/components/playerFigure/lib/posStringToNumber.js: -------------------------------------------------------------------------------- 1 | export function posStringToNumber(input) { 2 | if(typeof(input) == 'string'){ 3 | return Number(input.slice(0, input.length - 2)) 4 | }else if (typeof(input) == 'object'){ 5 | let result = JSON.parse(JSON.stringify(input)) 6 | for (let key of Object.keys(input)){ 7 | result[key] = posStringToNumber(input[key]) 8 | } 9 | return result 10 | }else{ 11 | return input 12 | } 13 | } -------------------------------------------------------------------------------- /src/components/startUpAndEnd/componentMixin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | data: function () { 3 | return { 4 | pos: { 5 | top: 100, 6 | left: 300 7 | } 8 | }; 9 | }, 10 | props: { 11 | index: { type: Number }, 12 | currentFocus: { type: Number }, 13 | opacity: { type: Number }, 14 | rotate: { type: Number }, 15 | zIndex: { type: Number }, 16 | destroy: { type: Boolean }, 17 | face:{type:String} 18 | }, 19 | methods: { 20 | moveComponent(event) { 21 | let self = this; 22 | event.target.addEventListener("mousemove", move); 23 | let startX = event.clientX; 24 | let startY = event.clientY; 25 | let startLeft = self.pos.left; 26 | let startTop = self.pos.top; 27 | 28 | function move(event) { 29 | if (event.buttons == 0) { 30 | event.target.removeEventListener("mousemove", move); 31 | return; 32 | } 33 | let xDiff = event.clientX - startX; 34 | let yDiff = event.clientY - startY; 35 | self.pos.left = startLeft + xDiff; 36 | self.pos.top = startTop + yDiff; 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/components/startUpAndEnd/filterGroup.js: -------------------------------------------------------------------------------- 1 | export default { 2 | data:function(){ 3 | return { 4 | filterGroup:[ 5 | { 6 | name: "none", 7 | value: "none" 8 | }, 9 | { 10 | name: "blur", 11 | value: "blur(4px)" 12 | }, 13 | { 14 | name: 'brightness', 15 | value: 'brightness(250%)' 16 | }, 17 | { 18 | name:'contrast', 19 | value:"contrast(180%)" 20 | }, 21 | { 22 | name: 'grayscale', 23 | value: "grayscale(100%)" 24 | }, 25 | { 26 | name: 'hue-rotate', 27 | value: "hue-rotate(180deg)" 28 | }, 29 | { 30 | name: 'invert', 31 | value: "invert(100%)" 32 | }, 33 | { 34 | name: 'saturate', 35 | value: "saturate(7)" 36 | }, 37 | { 38 | name: 'sepia', 39 | value: "sepia(100%)" 40 | }, 41 | { 42 | name: 'drop-shadow', 43 | value: "drop-shadow(8px 8px 10px green)" 44 | }, 45 | ] 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/components/startUpAndEnd/pictureComponent.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 65 | 66 | -------------------------------------------------------------------------------- /src/components/startUpAndEnd/textComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 91 | 92 | -------------------------------------------------------------------------------- /src/lib/_consistentStyle.scss: -------------------------------------------------------------------------------- 1 | %hover-effect { 2 | cursor: pointer; 3 | } 4 | 5 | @mixin buttonStyle($width,$height) { 6 | background-color:white; 7 | border-radius: 5px; 8 | width:$width; 9 | height:$height; 10 | border-style:solid; 11 | border-width:1px; 12 | transition:background-color 0.3s; 13 | outline:none; 14 | &:hover{ 15 | color:white; 16 | background-color:red; 17 | @extend %hover-effect 18 | } 19 | } 20 | 21 | $gameHeight:400px; 22 | $gameWidth:700px -------------------------------------------------------------------------------- /src/lib/gameLevel.js: -------------------------------------------------------------------------------- 1 | export default [` 2 | ................................... 3 | ................................... 4 | ................................... 5 | ................................... 6 | ................................... 7 | ................................... 8 | ................................... 9 | ................................... 10 | ................................... 11 | ................................... 12 | ................................... 13 | ................................... 14 | ................................... 15 | ................................... 16 | ................................... 17 | ................................... 18 | ................................... 19 | ..............................o.... 20 | .@................................. 21 | ###################################`]; 22 | 23 | -------------------------------------------------------------------------------- /src/lib/levelTemplate.js: -------------------------------------------------------------------------------- 1 | export default [` 2 | ................................................................................ 3 | ................................................................................ 4 | ................................................................................ 5 | ................................................................................ 6 | ................................................................................ 7 | ................................................................................ 8 | ..................................................................###........... 9 | ...................................................##......##....##+##.......... 10 | ....................................o.o......##..................#+++#.......... 11 | .................................................................##+##.......... 12 | ...................................#####..........................#v#........... 13 | ..##.........................................................................### 14 | ..#.......................................o.o................................#.. 15 | ..#.....................o....................................................#.. 16 | ..#......................................#####.............................o.#.. 17 | ..#..........####............................................................#.. 18 | ..#..@.......#..#................................................#####.......#.. 19 | ..############..###############...####################.....#######...#########.. 20 | ..............................#...#..................#.....#.................... 21 | ..............................#+++#..................#+++++#.................... 22 | ..............................#+++#..................#+++++#.................... 23 | ..............................#####..................#######.................... 24 | ................................................................................ 25 | ................................................................................ 26 | `, ` 27 | ................................................................................ 28 | ................................................................................ 29 | ....###############################............................................. 30 | ...##.............................##########################################.... 31 | ...#.......................................................................##... 32 | ...#....o..........................................................d........#... 33 | ...#................................................=.......................#... 34 | ...#.o........################...................o..o...........|........o..#... 35 | ...#.........................#..............................................#... 36 | ...#....o....................##########.....###################....##########... 37 | ...#..................................#+++++#.................#....#............ 38 | ...###############....oo......=o.o.o..#######.###############.#....#............ 39 | .....#...............o..o.............#.......#......#........#....#............ 40 | .....#....................#############..######.####.#.########....########..... 41 | .....#.............########..............#...........#.#..................#..... 42 | .....#..........####......####...#####################.#..................#..... 43 | .....#........###............###.......................########....########..... 44 | .....#.......##................#########################......#....#............ 45 | .....#.......#.........d......................................#....#............ 46 | .....###......................................................#....#............ 47 | .......#...............o...........................................#............ 48 | .......#...............................................o...........#............ 49 | .......#########......###.....############.........................##........... 50 | .............#..................#........#####....#######.o.........########.... 51 | .............#++++++++++++++++++#............#....#.....#..................#.... 52 | .............#++++++++++++++++++#..........###....###...####.o.............#.... 53 | .............####################..........#........#......#.....|.........#.... 54 | ...........................................#++++++++#......####............#.... 55 | ...........................................#++++++++#.........#........@...#.... 56 | ...........................................#++++++++#.........##############.... 57 | ...........................................##########........................... 58 | ................................................................................ 59 | `, ` 60 | ......................................#++#........................#######....................................#+#.. 61 | ......................................#++#.....................####.....####.................................#+#.. 62 | ......................................#++##########...........##...........##................................#+#.. 63 | ......................................##++++++++++##.........##.............##...........d...................#+#.. 64 | .......................................##########++#.........#....................................o...o...o..#+#.. 65 | ................................................##+#.........#.....o...o......................#....m........##+#.. 66 | .................................................#+#.........#................................###############++#.. 67 | .................................................#v#.........#.....#...#........................++++++++++++++##.. 68 | .....................d.......................................##..|...|...|..##............#####################... 69 | ..............................................................##+++++++++++##............v........................ 70 | ...............................................................####+++++####...................................... 71 | ...............................................#.....#............#######........###.........###.................. 72 | ...............................................#.....#...........................#.#.........#.#.................. 73 | ...............................................#.....#.............................#.........#.................... 74 | ...............................................#.....#.............................##........#.................... 75 | ...............................................##....#.............................#.........#.................... 76 | ...............................................#.....#......o..o.....#...#.........#.........#.................... 77 | ...............#######........###...###........#.....#...............#...#.........#.........#.................... 78 | ..............##.....##.........#...#..........#.....#.....######....#...#...#########.......#.................... 79 | .............##.......##........#.o.#..........#....##...............#...#...#...............#.................... 80 | .....@.......#.........#........#...#..........#.....#...............#...#...#...............#.................... 81 | ....###......#.........#........#...#..........#.....#...............#...#####...######......#.................... 82 | ....#.#......#.........#.......##.o.##.........#.....#...............#.....o.....#.#.........#.................... 83 | ++++#.#++++++#.........#++++++##.....##++++++++##....#++++++++++.....#.....m.....#.#.........#.................... 84 | ++++#.#++++++#.........#+++++##.......##########.....#+++++++##+.....#############.##..o.o..##.................... 85 | ++++#.#++++++#.........#+++++#....o.................##++++++##.+....................##..m..##..................... 86 | ++++#.#++++++#.........#+++++#.....................##++++++##..+.....................#######...................... 87 | ++++#.#++++++#.........#+++++##..m....##############++++++##...+.................................................. 88 | ++++#.#++++++#.........#++++++#########++++++++++++++++++##....+.................................................. 89 | ++++#.#++++++#.........#++++++++++++++++++++++++++++++++##.....+++++++++++++++++++++++++++++++++++++++++++++++++++ 90 | `, ` 91 | .............................................................................................................. 92 | .............................................................................................................. 93 | .............................................................................................................. 94 | .............................................................................................................. 95 | .............................................................................................................. 96 | ........................................o..................................................................... 97 | .............................................................................................................. 98 | ........................................#..................................................................... 99 | ........................................#.............d....................................................... 100 | ........................................#..................................................................... 101 | ........................................#..................................................................... 102 | .......................................###.................................................................... 103 | .......................................#.#.................+++........+++..###................................ 104 | .......................................#.#.................+#+........+#+..................................... 105 | .....................................###.###................#d.........#...................................... 106 | ....................d.................#...#.................#...oooo...#.......###............................ 107 | ......................................#...#.................#.....m....#......#+++#........................... 108 | ......................................#...#.................############.......###............................ 109 | .....................................##...##......#...#......#................................................ 110 | ......................................#...#########...########..............#.#............................... 111 | ......................................#...#...........#....................#+++#.............................. 112 | ......................................#...#...........#.....................###............................... 113 | .....................................##...##..........#....................................................... 114 | ......................................#...#=.=.=.=....#............###........................................ 115 | ......................................#...#...........#...........#+++#....................................... 116 | ......................................#...#....=.=.=.=#.....o......###.......###.............................. 117 | .....................................##...##..........#.....................#+++#............................. 118 | ..............................o...o...#...#...........#.....#................##v........###................... 119 | ......................................#...#...........#..............#.................#+++#.................. 120 | .............................###.##..###.###.....o.o..#++++++++++++++#...........d.......v#................... 121 | .............................#.###.....###.#..........#++++++++++++++#........................................ 122 | .............................#.............#...#######################........................................ 123 | .............................##...........##.........................................###...................... 124 | ..###.........................#.....#.....#.........................................#+++#................###.. 125 | ..#.#.........................#.d..###....#..........................................###.................#.#.. 126 | ..#...........................#....###....#######........................#####.............................#.. 127 | ..#...........................#...........#..............................#...#.............................#.. 128 | ..#...........................##..........#..............................#.#.#.............................#.. 129 | ..#......................................##.......|####|....|####|.....###.###.............................#.. 130 | ..#................###.............o.o....#..............................#.........###.....................#.. 131 | ..#...............#####.......##..........#.............................###.......#+++#..........#.........#.. 132 | ..#...............o###o.......#....###....#.............................#.#........###..........###........#.. 133 | ..#................###........#############..#.oo.#....#.oo.#....#.oo..##.##....................###........#.. 134 | ..#......@..........#...m.....#...........#++#....#++++#....#++++#....##...##.......m............#.........#.. 135 | ..#############################...........#############################.....################################.. 136 | .............................................................................................................. 137 | .............................................................................................................. 138 | `, ` 139 | ..................................................................................................###.#....... 140 | ......................................................................................................#....... 141 | ..................................................................................................#####....... 142 | ..................................................................................................#........... 143 | ..................................................................................................#.###....... 144 | ..........................o.......................................................................#.#.#....... 145 | .............................................................................................o.o.o###.#....... 146 | ...................###......................d.........................................................#....... 147 | .......+..o..+................................................#####.#####.#####.#####.#####.#####.#####....... 148 | .......#.....#................................................#...#.#...#.#...#.#...#.#...#.#...#.#........... 149 | .......#=.o..#............#...................................###.#.###.#.###.#.###.#.###.#.###.#.#####....... 150 | .......#.....#..................................................#.#...#.#...#.#...#.#...#.#...#.#.....#....... 151 | .......+..o..+.............d.................................####.#####.#####.#####.#####.#####.#######....... 152 | .........................oo................................................................................... 153 | ..........o..............###..............................##.................................................. 154 | .............................................................................................................. 155 | .............................................................................................................. 156 | ..........................d...........................##...................................................... 157 | ...................###.........###............................................................................ 158 | .............................................................................................................. 159 | ..........................o.....................................................#......#...................... 160 | ..........................................................##.....##........................................... 161 | .............###.........###.........###.................................#..................#................. 162 | .............................................................................................................. 163 | ......#####......................................................||........................................... 164 | ..#####...###................................................................................................. 165 | ..#.........#.o.#########.o.#########.o.##................................................#................... 166 | ..#.........#...#.......#...#.......#...#.................||..................#.....#......................... 167 | ..#.....@...#####...o...#####...o...#####..................................................................... 168 | ..#######.....................................#####.......##.....##.....###................................... 169 | ++++++++#=........m.........=..........m.....=#+++#.....................###................................... 170 | ++++++++#######################################+++#+++++++++++++++++++++###+++++++++++++++++++++++++++++++++++ 171 | ++++++++++++++++++++++++++++++++++++++++++++++++++############################################################ 172 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 173 | `, ` 174 | .............................................................................................................. 175 | ...............................................d.............................................................. 176 | ..............ooo..........ooo.........ooo........ooo........ooo..........ooo....d.....oo..................... 177 | ..............###..........###....d....###........###........###..........###..........###.................... 178 | ........d.............................................................d....................................... 179 | .........oo....d....ooo..........ooo.........ooo.......ooo..........ooo.........ooo.........o................. 180 | ........###.........###..........###.........###.......###..........###.........###.........###............... 181 | ...........................................................................d............................d..... 182 | ...................................d.....................................................d.................... 183 | ..............ooo..........ooo.........ooo........ooo........ooo..........ooo..........ooo.................... 184 | ..............###..........###.........###........###........###..........###..........###.................... 185 | ........d...............................................d..................................................... 186 | .........oo.........ooo..........ooo.........ooo.......ooo..........ooo.....................oo................ 187 | ........###.........###..........###.........###.......###..........###.........###.........###............... 188 | ...........................d...............................d.................................................. 189 | ..................................................................................d........................... 190 | ...d..........ooo..........ooo.........ooo........ooo........ooo..........ooo..........ooo.................... 191 | ..............###..........###.........###........###........###..........###..........###............d....... 192 | .........d.................................................................................................... 193 | .........oo.........ooo..........ooo.........ooo.......ooo..........ooo.........ooo.........oo................ 194 | ........###.........###..........###.........###.......###..........###.........###.........###............... 195 | .............................................................................................................. 196 | ..................................d........................................................................... 197 | ...........@................o...........o...........o...........o........................o.......d............ 198 | #################++++++++++###+++++++++###+++++++++###++++++++###++++++++++###++++++++++###+++++++++++++++++++ 199 | 200 | ` 201 | ] -------------------------------------------------------------------------------- /src/lib/mobileRouterProtect.js: -------------------------------------------------------------------------------- 1 | export default { 2 | created(){ 3 | if (this.is_touch_device()) { 4 | alert(`${this.lang === 1 ?"游戏设计需在电脑端完成,以获得最佳体验" 5 | :"To get the best experience, please start your design on computer."}`) 6 | this.$router.push('/') 7 | } 8 | }, 9 | methods:{ 10 | is_touch_device() { 11 | return ( 12 | "ontouchstart" in window || 13 | navigator.MaxTouchPoints > 0 || 14 | navigator.msMaxTouchPoints > 0 15 | ); 16 | }, 17 | } 18 | } -------------------------------------------------------------------------------- /src/lib/previewPageData.js: -------------------------------------------------------------------------------- 1 | exports.levelMap = ["................................................................................\n................................................................................\n................................................................................\n................................................................................\n.............................................................d..................\n................................................................................\n..................................................................###...........\n...................................................##......##....##+##..........\n....................................o.o......##..................#+++#..........\n.................................................................##+##..........\n...................................#####..........................#v#...........\n..##.........................................................................###\n..#.......................................o.o................................#..\n..#.....................o....................................................#..\n..#......................................#####.............................o.#..\n..#..........####............................................................#..\n..#..@.......#..#................................................#####m......#..\n..############..###############...####################.....#######...#########..\n..............................#...#..................#.....#....................\n..............................#+++#..................#+++++#....................\n..............................#+++#..................#+++++#....................\n..............................#####..................#######....................\n................................................................................\n................................................................................", "...................................\n...................................\n.........................o.........\n...................................\n........................#.#........\n.......................#.#.#.......\n........................#.#........\n..................o......#.........\n.................###...............\n...................................\n.............o.....................\n............###....................\n...................................\n........o..........................\n.......###.........................\n...................................\n..............o....................\n.............###...................\n.@.................................\n###################################"] 2 | 3 | exports.levelSetting = [{ "backgroundColor": "#34a6fb", "backgroundImage": null }, { "backgroundColor": "#34a6fb", "backgroundImage": null }]; 4 | 5 | exports.globalSetting = { 6 | lives: 3, 7 | size: 1, 8 | speed: 7, 9 | jumpSpeed: 17, 10 | playerSprites: null 11 | } 12 | 13 | exports.startUpBtn = { "left": "301px", "top": "164px", "width": "131px", "height": "131px", "borderRadius": "129px", "color": "#000000", "backgroundColor": "#ffbea7", "borderWidth": "7px", "borderColor": "#ff8560", "fontSize": "30px", "zIndex": 100,"position":"absolute",} 14 | 15 | exports.startUpBtnText = "GO"; 16 | 17 | exports.startBackgroundStyle = { "backgroundImage": "", "backgroundColor": "#74c2ee", "backgroundSize": "700px 400px", "backgroundRepeat": "no-repeat" } 18 | 19 | exports.startTextComponents = [{ "style": { "top": "34px", "left": "-18px", "fontSize": "107px", "color": "#ffdc9c", "opacity": 1, "transform": "rotate(-46deg)", "zIndex": 0, "position": "absolute" }, "textContent": "DIYGAME" }] 20 | 21 | exports.startPictureComponents = [{ style: { "top": "-28px", "left": "104px", "opacity": 0.2, "transform": "rotate(0deg)", "zIndex": 0, "filter": "none", "position": "absolute" }, width: 493, url: "" }] 22 | 23 | exports.endBackgroundStyle = { "backgroundImage": "", "backgroundColor": "#000000", "backgroundSize": "cover", "backgroundRepeat": "no-repeat" } 24 | 25 | exports.processTextFlow = { 26 | style: { 27 | position: "absolute", 28 | top: "223px", 29 | left: "207px", 30 | fontSize: "30px", 31 | color: "#ff0029", 32 | zIndex: 100, 33 | }, 34 | animate: { 35 | animation: true, 36 | animationTime: 20, 37 | animationDir: "top", 38 | animationDistance: 935, 39 | }, 40 | textContent: 41 | "\nYour message Here:\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX\nXXXXXXXXXXXXXX", 42 | }; -------------------------------------------------------------------------------- /src/lib/rangeInputStyle.css: -------------------------------------------------------------------------------- 1 | input[type=range] { 2 | height: 5px; 3 | -webkit-appearance: none; 4 | width: 100%; 5 | } 6 | input[type=range]:focus { 7 | outline: none; 8 | } 9 | input[type=range]::-webkit-slider-runnable-track { 10 | width: 100%; 11 | height: 5px; 12 | cursor: pointer; 13 | box-shadow: 0px 0px 0px #000000; 14 | background: #2497E3; 15 | border-radius: 1px; 16 | border: 0px solid #000000; 17 | } 18 | input[type=range]::-webkit-slider-thumb { 19 | box-shadow: 0px 0px 0px #000000; 20 | border: 1px solid #2497E3; 21 | height: 18px; 22 | width: 18px; 23 | border-radius: 25px; 24 | background: #A1D0FF; 25 | cursor: pointer; 26 | -webkit-appearance: none; 27 | margin-top: -7px; 28 | } 29 | input[type=range]:focus::-webkit-slider-runnable-track { 30 | background: #2497E3; 31 | } 32 | input[type=range]::-moz-range-track { 33 | width: 100%; 34 | height: 5px; 35 | cursor: pointer; 36 | box-shadow: 0px 0px 0px #000000; 37 | background: #2497E3; 38 | border-radius: 1px; 39 | border: 0px solid #000000; 40 | } 41 | input[type=range]::-moz-range-thumb { 42 | box-shadow: 0px 0px 0px #000000; 43 | border: 1px solid #2497E3; 44 | height: 18px; 45 | width: 18px; 46 | border-radius: 25px; 47 | background: #A1D0FF; 48 | cursor: pointer; 49 | } 50 | input[type=range]::-ms-track { 51 | width: 100%; 52 | height: 5px; 53 | cursor: pointer; 54 | background: transparent; 55 | border-color: transparent; 56 | color: transparent; 57 | } 58 | input[type=range]::-ms-fill-lower { 59 | background: #2497E3; 60 | border: 0px solid #000000; 61 | border-radius: 2px; 62 | box-shadow: 0px 0px 0px #000000; 63 | } 64 | input[type=range]::-ms-fill-upper { 65 | background: #2497E3; 66 | border: 0px solid #000000; 67 | border-radius: 2px; 68 | box-shadow: 0px 0px 0px #000000; 69 | } 70 | input[type=range]::-ms-thumb { 71 | margin-top: 1px; 72 | box-shadow: 0px 0px 0px #000000; 73 | border: 1px solid #2497E3; 74 | height: 18px; 75 | width: 18px; 76 | border-radius: 25px; 77 | background: #A1D0FF; 78 | cursor: pointer; 79 | } 80 | input[type=range]:focus::-ms-fill-lower { 81 | background: #2497E3; 82 | } 83 | input[type=range]:focus::-ms-fill-upper { 84 | background: #2497E3; 85 | } 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | //fontawesome 6 | import { library } from '@fortawesome/fontawesome-svg-core' 7 | import { faCrop, faMousePointer, faEraser, faCircle, faAngleLeft, faAngleRight, faCut, faMinus, faArrowLeft, faUndo, faPlus, faBirthdayCake, faHeartbeat, faLightbulb, faCogs, faMale, faGamepad,faLaptop} from '@fortawesome/free-solid-svg-icons' 8 | import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' 9 | 10 | library.add(faCrop, faMousePointer, faEraser, faAngleRight, faCut, faMinus, faArrowLeft, faCircle, faAngleLeft, faAngleRight, faUndo, faPlus, faBirthdayCake, faHeartbeat, faLightbulb, faCogs, faMale, faGamepad, faLaptop) 11 | Vue.component('font-awesome-icon', FontAwesomeIcon) 12 | 13 | Vue.config.productionTip = false 14 | 15 | new Vue({ 16 | router, 17 | store, 18 | render: h => h(App) 19 | }).$mount('#app') 20 | -------------------------------------------------------------------------------- /src/pic/helpPage/donePlayerFigure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/donePlayerFigure.png -------------------------------------------------------------------------------- /src/pic/helpPage/endFaceAnimation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/endFaceAnimation.png -------------------------------------------------------------------------------- /src/pic/helpPage/enterEntireGame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/enterEntireGame.png -------------------------------------------------------------------------------- /src/pic/helpPage/entireGameIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/entireGameIntro.png -------------------------------------------------------------------------------- /src/pic/helpPage/entireGamePanelIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/entireGamePanelIntro.png -------------------------------------------------------------------------------- /src/pic/helpPage/faceDesignPanelIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/faceDesignPanelIntro.png -------------------------------------------------------------------------------- /src/pic/helpPage/faceDesignResult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/faceDesignResult.png -------------------------------------------------------------------------------- /src/pic/helpPage/gameDesignPanelIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/gameDesignPanelIntro.png -------------------------------------------------------------------------------- /src/pic/helpPage/gameDesignResult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/gameDesignResult.png -------------------------------------------------------------------------------- /src/pic/helpPage/pictureCombinePanelIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/pictureCombinePanelIntro.png -------------------------------------------------------------------------------- /src/pic/helpPage/playerCrop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/playerCrop.png -------------------------------------------------------------------------------- /src/pic/helpPage/playerFIgurePanelIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/playerFIgurePanelIntro.png -------------------------------------------------------------------------------- /src/pic/helpPage/playerFigureErase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/playerFigureErase.png -------------------------------------------------------------------------------- /src/pic/helpPage/playerFigureResult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/playerFigureResult.png -------------------------------------------------------------------------------- /src/pic/helpPage/selectFaceDesign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/selectFaceDesign.png -------------------------------------------------------------------------------- /src/pic/helpPage/selectGameDesign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/selectGameDesign.png -------------------------------------------------------------------------------- /src/pic/helpPage/selectPlayerFigure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/selectPlayerFigure.png -------------------------------------------------------------------------------- /src/pic/helpPage/structureDesignPanelIntro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/helpPage/structureDesignPanelIntro.png -------------------------------------------------------------------------------- /src/pic/home/DIYGAMElogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/home/DIYGAMElogo.png -------------------------------------------------------------------------------- /src/pic/home/firstPoster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/home/firstPoster.png -------------------------------------------------------------------------------- /src/pic/home/secondPoster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/home/secondPoster.png -------------------------------------------------------------------------------- /src/pic/home/thirdPoster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/home/thirdPoster.jpg -------------------------------------------------------------------------------- /src/pic/playerFigure/headless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/playerFigure/headless.png -------------------------------------------------------------------------------- /src/pic/playerFigure/oneBody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/playerFigure/oneBody.png -------------------------------------------------------------------------------- /src/pic/preViewPage/DIYGAMElogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/preViewPage/DIYGAMElogo.png -------------------------------------------------------------------------------- /src/pic/preViewPage/endFaceBackground.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/preViewPage/endFaceBackground.jpg -------------------------------------------------------------------------------- /src/pic/preViewPage/previewLevelBackground1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/preViewPage/previewLevelBackground1.jpg -------------------------------------------------------------------------------- /src/pic/preViewPage/previewLevelBackground2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/preViewPage/previewLevelBackground2.png -------------------------------------------------------------------------------- /src/pic/preViewPage/previewPagePlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/preViewPage/previewPagePlayer.png -------------------------------------------------------------------------------- /src/pic/pureGame/Monster1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/Monster1.png -------------------------------------------------------------------------------- /src/pic/pureGame/Monster2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/Monster2.png -------------------------------------------------------------------------------- /src/pic/pureGame/Monster3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/Monster3.png -------------------------------------------------------------------------------- /src/pic/pureGame/Monster4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/Monster4.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon1.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon10.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon2.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon3.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon4.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon5.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon6.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon7.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon8.png -------------------------------------------------------------------------------- /src/pic/pureGame/dragon9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/dragon9.png -------------------------------------------------------------------------------- /src/pic/pureGame/fire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/fire1.png -------------------------------------------------------------------------------- /src/pic/pureGame/fire2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/fire2.png -------------------------------------------------------------------------------- /src/pic/pureGame/fire3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/fire3.png -------------------------------------------------------------------------------- /src/pic/pureGame/fire4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/fire4.png -------------------------------------------------------------------------------- /src/pic/pureGame/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/player.png -------------------------------------------------------------------------------- /src/pic/pureGame/rose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/rose.png -------------------------------------------------------------------------------- /src/pic/pureGame/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/sprites.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire1.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire2.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire3.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire4.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire5.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire6.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire7.png -------------------------------------------------------------------------------- /src/pic/pureGame/tofire8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/pureGame/tofire8.png -------------------------------------------------------------------------------- /src/pic/structureComponent/coinIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/coinIcon.png -------------------------------------------------------------------------------- /src/pic/structureComponent/dragonIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/dragonIcon.png -------------------------------------------------------------------------------- /src/pic/structureComponent/lavaIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/lavaIcon1.png -------------------------------------------------------------------------------- /src/pic/structureComponent/lavaIcon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/lavaIcon2.png -------------------------------------------------------------------------------- /src/pic/structureComponent/lavaIcon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/lavaIcon3.png -------------------------------------------------------------------------------- /src/pic/structureComponent/lavaIcon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/lavaIcon4.png -------------------------------------------------------------------------------- /src/pic/structureComponent/monsterIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/monsterIcon.png -------------------------------------------------------------------------------- /src/pic/structureComponent/playerIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/playerIcon.png -------------------------------------------------------------------------------- /src/pic/structureComponent/wallIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/src/pic/structureComponent/wallIcon.png -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from './views/Home.vue' 4 | 5 | Vue.use(Router) 6 | 7 | const router = new Router({ 8 | base: process.env.BASE_URL, 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'home', 13 | component: Home, 14 | }, 15 | { 16 | path: '/playerFigure', 17 | component: () => import(/* webpackChunkName: "playerFigure" */ './views/playerFigure.vue'), 18 | 19 | children: [ 20 | { 21 | path: '', 22 | component: () => import(/* webpackChunkName: "playerFigure" */ './components/playerFigure/PictureEdit.vue'), 23 | }, 24 | { 25 | path: 'combine', 26 | component: () => import(/* webpackChunkName: "playerFigure" */ './components/playerFigure/PictureCombine.vue') 27 | }, 28 | ] 29 | }, 30 | { 31 | path: '/entireGame', 32 | component: () => import(/* webpackChunkName: "entireGame" */ './views/entireGame.vue'), 33 | }, 34 | { 35 | path: '/gameDesign', 36 | component: () => import(/* webpackChunkName: "gameDesign" */ './views/gameDesign.vue'), 37 | }, 38 | { 39 | path: '/startUpAndEndDesign', 40 | component: () => import(/* webpackChunkName:"startUpAndEndDesign"*/ './views/startUpAndEndDesign.vue') 41 | }, 42 | { 43 | path: '/previewPage', 44 | component: () => import(/*webpackChunkName:"previewPage"*/ './views/previewPage.vue') 45 | }, 46 | { 47 | path: '/help', 48 | component: () => import(/*webpackChunkName:"help"*/ './views/help.vue') 49 | } 50 | ] 51 | }) 52 | 53 | router.beforeEach((to, from, next) => { 54 | // If this isn't an initial page load. 55 | // Start the route progress bar. 56 | NProgress.start() 57 | next() 58 | }) 59 | 60 | router.afterEach((to, from) => { 61 | // Complete the animation of the route progress bar. 62 | setTimeout(()=>{ 63 | NProgress.done() 64 | },500) 65 | }) 66 | 67 | 68 | export default router; -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import defaultGameMap from './lib/gameLevel' 4 | 5 | Vue.use(Vuex) 6 | 7 | const restoreData = (state, value) => { 8 | for (let key in value) { 9 | state[key] = value[key] 10 | } 11 | } 12 | 13 | let playerFigure = { 14 | namespaced: true, 15 | state: { 16 | //存储的是能拿来渲染的image的数据 17 | imgData: null, 18 | width: null, 19 | height: null, 20 | x: 0, 21 | y: 0, 22 | src: null, 23 | }, 24 | mutations: { 25 | uploadImgData(state, valuePair) { 26 | Object.keys(valuePair).forEach(key => { 27 | state[key] = valuePair[key] 28 | }) 29 | }, 30 | uploadImgSrc(state, src) { 31 | state.src = src 32 | }, 33 | clearAll(state) { 34 | Object.keys(state).forEach(key => { 35 | state[key] = null 36 | }) 37 | }, 38 | }, 39 | }; 40 | 41 | let gameLevel = { 42 | namespaced: true, 43 | state: { 44 | levelMap: [], 45 | levelSetting: [], 46 | currentLevel: 0, 47 | structureDesign: false, 48 | globalPlayerSetting: { 49 | lives: 3, 50 | size: 1, 51 | speed: 7, 52 | jumpSpeed: 17, 53 | playerSprites: null 54 | } 55 | }, 56 | mutations: { 57 | addLevel(state) { 58 | state.levelMap.push(defaultGameMap[0]); 59 | state.levelSetting.push({ 60 | backgroundColor: '#34a6fb', 61 | backgroundImage: null 62 | }) 63 | state.currentLevel = state.levelMap.length - 1 64 | }, 65 | changeGameMap(state, newMap) { 66 | //看看是否需要注意响应式属性的问题 67 | if (typeof newMap != 'string') throw new Error('the map not a string' + newMap) 68 | Vue.set(state.levelMap, state.currentLevel, newMap) 69 | }, 70 | changeLevel(state, newLevel) { 71 | state.currentLevel = newLevel 72 | }, 73 | toggleStructureDesign(state) { 74 | state.structureDesign = !state.structureDesign 75 | }, 76 | changeBackgroundColor(state, color) { 77 | state.levelSetting[state.currentLevel].backgroundColor = color 78 | }, 79 | changeBackgroundImage(state, image) { 80 | state.levelSetting[state.currentLevel].backgroundImage = image 81 | }, 82 | changeGlobalPlayerSetting(state, valuePair) { 83 | Object.keys(valuePair).forEach(key => { 84 | state.globalPlayerSetting[key] = valuePair[key] 85 | }) 86 | }, 87 | restoreData 88 | } 89 | } 90 | 91 | const startUpAndEndFaceGetters = { 92 | getComponentPropertyByIndex: (state) => (type, index) => { 93 | if (type === 'text') { 94 | return state.textComponents[index] 95 | } else if (type === 'picture') { 96 | return state.pictureComponents[index] 97 | } else { 98 | throw new Error('no such type') 99 | } 100 | }, 101 | //可直接使用的style 102 | processTextComponent: (state) => { 103 | return state.textComponents.map(component => { 104 | return { 105 | style: { 106 | top: component.top + "px", 107 | left: component.left + "px", 108 | fontSize: component.fontSize + "px", 109 | color: component.color, 110 | opacity: component.opacity, 111 | transform: `rotate(${component.rotate}deg)`, 112 | zIndex: component.zIndex, 113 | position: "absolute" 114 | }, 115 | textContent: component.textContent 116 | } 117 | }) 118 | }, 119 | //可直接使用的style 120 | processPictureComponent: (state) => { 121 | return state.pictureComponents.map(component => { 122 | return { 123 | style: { 124 | top: component.top + "px", 125 | left: component.left + "px", 126 | opacity: component.opacity, 127 | transform: `rotate(${component.rotate}deg)`, 128 | zIndex: component.zIndex, 129 | filter: component.filter, 130 | position: "absolute" 131 | }, 132 | url: component.url, 133 | width: component.width 134 | } 135 | }) 136 | } 137 | } 138 | 139 | const startUpFaceMutations = { 140 | addPictureComponents(state, style) { 141 | style.index = state.pictureComponents.length; 142 | state.pictureComponents.push(style) 143 | }, 144 | addTextComponents(state, style) { 145 | style.index = state.textComponents.length; 146 | state.textComponents.push(style) 147 | }, 148 | restart(state) { 149 | state.pictureComponents = []; 150 | state.textComponents = []; 151 | }, 152 | changeData(state, style) { 153 | for (let key in style) { 154 | if (state[key] == undefined) throw new Error('no such keys') 155 | state[key] = style[key] 156 | } 157 | }, 158 | restoreData 159 | } 160 | 161 | let startUpFace = { 162 | namespaced: true, 163 | state: { 164 | startUpBtn: { 165 | left: "300px", 166 | top: "150px", 167 | width: "100px", 168 | height: "80px", 169 | borderRadius: "10px", 170 | color: "#000000", 171 | backgroundColor: "#ffffff", 172 | borderWidth: "1px", 173 | borderColor: "#0000ff", 174 | fontSize: "20px", 175 | zIndex: 100 176 | }, 177 | pictureComponents: [], 178 | textComponents: [], 179 | backgroundStyle: { 180 | backgroundImage: "", 181 | backgroundColor: "#000000", 182 | backgroundSize: "700px 400px", 183 | backgroundRepeat: "no-repeat", 184 | }, 185 | startUpBtnText: "GO", 186 | }, 187 | getters: startUpAndEndFaceGetters, 188 | mutations: startUpFaceMutations 189 | } 190 | 191 | let endFace = { 192 | namespaced: true, 193 | state: { 194 | pictureComponents: [], 195 | textComponents: [], 196 | backgroundStyle: { 197 | backgroundImage: "", 198 | backgroundColor: "#000000", 199 | backgroundSize: "700px 400px", 200 | backgroundRepeat: "no-repeat", 201 | }, 202 | textFlowStyle: { 203 | //top left存储的是实时位置 204 | //startTop startLeft是有动画时候的初始位置 205 | top: "270px", 206 | left: "265px", 207 | fontSize: "30px", 208 | color: '#fbff20', 209 | zIndex: 100, 210 | animation: true, 211 | animationTime: 10, 212 | animationDir: 'top', 213 | animationDistance: 200, 214 | }, 215 | textFlowText: "XXXXXXXX\nXXXXXXXX" 216 | }, 217 | getters: Object.assign({}, startUpAndEndFaceGetters, { 218 | processTextFlow: (state) => { 219 | return { 220 | style: { 221 | position: 'absolute', 222 | top: state.textFlowStyle.top, 223 | left: state.textFlowStyle.left, 224 | fontSize: state.textFlowStyle.fontSize, 225 | color: state.textFlowStyle.color, 226 | zIndex: 100, 227 | }, 228 | animate: { 229 | animation: state.textFlowStyle.animation, 230 | animationTime: state.textFlowStyle.animationTime, 231 | animationDir: state.textFlowStyle.animationDir, 232 | animationDistance: state.textFlowStyle.animationDistance, 233 | }, 234 | textContent: state.textFlowText 235 | } 236 | } 237 | }), 238 | mutations: startUpFaceMutations 239 | } 240 | 241 | export default new Vuex.Store({ 242 | strict: process.env.NODE_ENV !== 'production', 243 | state:{ 244 | lang: 2, // 1为中文,2为英语 245 | }, 246 | mutations:{ 247 | changeLanguage(state, lang){ 248 | state.lang = lang 249 | } 250 | }, 251 | modules: { 252 | playerFigure, 253 | gameLevel, 254 | startUpFace, 255 | endFace 256 | } 257 | }) 258 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 79 | 80 | 110 | 111 | 330 | 331 | 332 | 333 | 334 | -------------------------------------------------------------------------------- /src/views/entireGame.vue: -------------------------------------------------------------------------------- 1 | 68 | 69 | 419 | 420 | 472 | 473 | 474 | -------------------------------------------------------------------------------- /src/views/gameDesign.vue: -------------------------------------------------------------------------------- 1 | 103 | 104 | 249 | 250 | 395 | 396 | 397 | 398 | -------------------------------------------------------------------------------- /src/views/help.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 51 | 52 | 125 | 126 | -------------------------------------------------------------------------------- /src/views/playerFigure.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /src/views/previewPage.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 285 | 286 | -------------------------------------------------------------------------------- /src/views/startUpAndEndDesign.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 32 | 33 | -------------------------------------------------------------------------------- /tests/gameClass/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 39 | 40 | 41 | 42 |
43 |
44 |
45 |
46 |
47 | 48 | 49 | 203 | 204 | -------------------------------------------------------------------------------- /tests/gameClass/img/coinIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/img/coinIcon1.png -------------------------------------------------------------------------------- /tests/gameClass/img/lavaIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/img/lavaIcon1.png -------------------------------------------------------------------------------- /tests/gameClass/img/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/img/player.png -------------------------------------------------------------------------------- /tests/gameClass/img/playerIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/img/playerIcon1.png -------------------------------------------------------------------------------- /tests/gameClass/img/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/img/sprites.png -------------------------------------------------------------------------------- /tests/gameClass/img/wallIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/img/wallIcon1.png -------------------------------------------------------------------------------- /tests/gameClass/pic/Monster1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/Monster1.png -------------------------------------------------------------------------------- /tests/gameClass/pic/Monster2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/Monster2.png -------------------------------------------------------------------------------- /tests/gameClass/pic/Monster3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/Monster3.png -------------------------------------------------------------------------------- /tests/gameClass/pic/Monster4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/Monster4.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon1.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon10.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon2.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon3.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon4.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon5.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon6.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon7.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon8.png -------------------------------------------------------------------------------- /tests/gameClass/pic/dragon9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/dragon9.png -------------------------------------------------------------------------------- /tests/gameClass/pic/fire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/fire1.png -------------------------------------------------------------------------------- /tests/gameClass/pic/fire2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/fire2.png -------------------------------------------------------------------------------- /tests/gameClass/pic/fire3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/fire3.png -------------------------------------------------------------------------------- /tests/gameClass/pic/fire4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/fire4.png -------------------------------------------------------------------------------- /tests/gameClass/pic/rose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/rose.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire1.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire2.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire3.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire4.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire5.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire6.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire7.png -------------------------------------------------------------------------------- /tests/gameClass/pic/tofire8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lawliet01/DIYGame/5e23199b5ff87df1f14cc8bcc57a516c36818c85/tests/gameClass/pic/tofire8.png -------------------------------------------------------------------------------- /tests/gameClass/test.js: -------------------------------------------------------------------------------- 1 | console.log('happy') 2 | -------------------------------------------------------------------------------- /tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | } 5 | } -------------------------------------------------------------------------------- /tests/unit/example.spec.js: -------------------------------------------------------------------------------- 1 | import store from '../../src/store'; 2 | import {createLocalVue} from '@vue/test-utils'; 3 | import Vuex from 'vuex'; 4 | 5 | 6 | describe('storeTest',()=>{ 7 | const localVue = createLocalVue(); 8 | localVue.use(Vuex); 9 | it('uploadData',()=>{ 10 | expect(store.state.playerFigure.imgData).toBe(null); 11 | store.commit('playerFigure/uploadImgData', {imgData:123,width:10,height:20,x:5,y:5}); 12 | expect(store.state.playerFigure.imgData).toBe(123); 13 | expect(store.state.playerFigure.width).toBe(10) 14 | expect(store.state.playerFigure.height).toBe(20); 15 | expect(store.state.playerFigure.x).toBe(5); 16 | expect(store.state.playerFigure.y).toBe(5); 17 | }) 18 | }) 19 | 20 | function getImage(name){ 21 | let image = new Image(); 22 | image.src = requireContext['./' + name]; 23 | return image 24 | } -------------------------------------------------------------------------------- /tests/unit/pureGameTest.spec.js: -------------------------------------------------------------------------------- 1 | function getPicSrc(path, name, n = 1, type) { 2 | //如果只有一张图,那么name要有拓展名 3 | //如果有多张图,那么拓展名放在type里面 4 | let image = new Image(); 5 | if (n == 1) { 6 | image.src = path + '/' + name; 7 | return image; 8 | } else { 9 | let imageSrc = Array.apply(null, { length: n }).map(function (_, index) { 10 | let number = index + 1; 11 | return path + '/' + name + number.toString() + '.' + type 12 | }) 13 | return [image, imageSrc] 14 | } 15 | } 16 | 17 | 18 | describe('testGetPicSrc',()=>{ 19 | 20 | // it('onePicture',()=>{ 21 | // let otherSprites = getPicSrc('../pic/pureGame/basicUse','sprites.png'); 22 | // expect(otherSprites.src).toBe('../pic/pureGame/basicUse/sprites.png'); 23 | // }) 24 | 25 | it('multiPicture',()=>{ 26 | let [monsterSprites, monsterSpritesSrc] = getPicSrc('../pic/pureGame/actors','dragon',10,'png'); 27 | expect(monsterSpritesSrc[0]).toBe('../pic/pureGame/actors/dragon1.png') 28 | expect(monsterSpritesSrc.length).toBe(10) 29 | }) 30 | }) -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | // module.exports = { 2 | // publicPath: process.env.NODE_ENV === 'production' 3 | // ? '/diyGame/' 4 | // : '/' 5 | // }; --------------------------------------------------------------------------------