2 Star 0 Fork 1

nineteen / pxt-arcade

forked from mirrors_microsoft / pxt-arcade 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Casual game editor using Microsoft MakeCode Build Status

This repo contains the Arcade editor built with Microsoft MakeCode (PXT).

Creating and editing a package

In the editor, you will find a GitHub icon next to the save icon. Use the GitHub integration to build a library package. You do not need to install the local dev server; everything can happen in the editor.

Local server setup

This setup gives you a local version of the editor and the ability to load packages from your machine. This is the setup to develop new packages.

Setup

git clone https://github.com/microsoft/pxt-arcade
  • go to pxt-arcade and run
cd pxt-arcade
npm install

Don't forget to periodically git pull and npm install to get the latest changes.

git pull
npm install

Launching the server

This command launches a local web server. Note that this web server is meant for development purposes only. It was not designed or secured to be run on a web server.

npm run serve

Refreshing the community.md file

Run this command, then patch description, improve the screenshot (or record gifs) if necessary.

pxt ddt featured-game --md docs/community.md

This command requires ImageMagick (https://imagemagick.org/index.php) to be installed and available at the command line as "magick".

Update playlists in markdown

Get a Google API key and store it in the GOOGLE_API_KEY environment variables (turn on data from the app).

pxt downloadplaylists

How to create sprite packs

Packs of images can be added to the editor using PXT packages. To create a package of images.

  1. Create a package (see steps above)
  2. Prepare your sprites in a spritesheet: All sprites in a sheet must be the same size and arranged in a grid with no gaps. Spritesheets must be PNG files. An example spritesheet is located here
  3. Inside the package directory, create a subdirectory where the assets will be placed and copy the spritesheet containing your images into it.
  4. Create a file named meta.json in the directory you created. An example meta.json can be found here and documentation on all of the options can be found here
  5. Create another .json file with the same basename as the spritesheet.
  6. Inside that file add a single property called frames which maps to an array of names for the sprites. Indices start in the top left of the sheet and proceed left to right. For a sample file see here
  7. From the root of your package, run the command pxt buildsprites SUBDIR where SUBDIR is the name of the directory containing the assets.
  8. Two files will be generated in the package root, one with the extenstion .ts and one with the extension .jres. Add both to the package's pxt.json
  9. You're done! The images will show up in the Image category when the package is added to a project

Local Dev setup

These instructions allow you to test changes to pxt-core and pxt-common-packages. They are more involved as you need to clone and link 3 repos.

  • install Node.js 8+
  • (optional) install Visual Studio Code
  • install the pxt command line tool
[sudo] npm install -g pxt

In a common folder,

npm install
npm run build
  • go to pxt-common-packages and run
npm install
pxt link ../pxt
  • go to pxt-arcade and run
npm install
pxt link ../pxt
pxt link ../pxt-common-packages

to run the local server

From root github folder,

cd pxt-arcade
pxt serve --rebundle

More instructions at https://github.com/microsoft/pxt#running-a-target-from-localhost

to watch for changes

To rebuild automatically when changes are made, we need gulp.

Install gulp:

npm install -g gulp

and in a seperate terminal from pxt serve and in the pxt/ folder, run:

gulp watch

Viewing documents

Documents are rendered at the server and are viewable when received by the browser. Special styles and extended formatting are used which prevent them from rendering properly as generalized Markdown. While you can browse them here in the repo, they are not meant to render properly as GitHub document.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

MICROSOFT, the Microsoft Logo, MAKECODE, and MAKECODE ARCADE are registered trademarks of Microsoft Corporation. They can only be used for the purposes described in and in accordance with Microsoft’s Trademark and Brand guidelines published at https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general.aspx. If the use is not covered in Microsoft’s published guidelines or you are not sure, please consult your legal counsel or MakeCode team (makecode@microsoft.com).

MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/nineteenspace/pxt-arcade.git
git@gitee.com:nineteenspace/pxt-arcade.git
nineteenspace
pxt-arcade
pxt-arcade
master

搜索帮助