MakeCode Arcade extension for handling multiple tilemaps and extra tilemap blocks - beta
Перейти к файлу
Joey Wunderlich 611bf5ce1a
Merge pull request #22 from microsoft/users/GitHubPolicyService/b2cb1afd-66dc-4c74-a958-87bf9950987d
Adding Microsoft SECURITY.MD
2022-08-17 10:14:27 -07:00
.github/workflows 1.8.1 2020-07-17 16:34:14 -07:00
.vscode Initial files for MakeCode project 2019-12-22 19:36:55 -08:00
assets 1.10.0 2020-10-20 12:26:31 -07:00
tiles Fixing tags 2020-10-20 12:09:06 -07:00
.gitattributes 1.8.1 2020-07-17 16:34:14 -07:00
.gitignore Initialize empty repo 2019-12-22 19:36:49 -08:00
LICENSE fix license and copyright 2020-04-07 07:33:51 -07:00
Makefile Initial files for MakeCode project 2019-12-22 19:36:55 -08:00
README.md Update README.md 2020-09-21 14:50:51 -07:00
SECURITY.md Microsoft mandatory file 2022-08-17 14:48:20 +00:00
icon.png rename icon 2020-09-23 09:53:29 -07:00
index.html 1.8.1 2020-07-17 16:34:14 -07:00
main.blocks Initial files for MakeCode project 2019-12-22 19:36:55 -08:00
overworld.ts Update doc comment 2021-09-09 14:50:54 -07:00
pxt.json 1.12.0 2021-09-14 18:43:42 -07:00
search.ts Switching col/row to use tile location 2020-01-19 11:56:18 -08:00
test.ts Initial files for MakeCode project 2019-12-22 19:36:55 -08:00
tilemap.ts add getTileAtLocation 2021-02-23 13:46:27 -08:00
tiles.util.jres Fixing namespace and files 2020-10-20 11:57:48 -07:00
tiles.util.ts Fixing tags 2020-10-20 12:09:06 -07:00
tsconfig.json Initial files for MakeCode project 2019-12-22 19:36:55 -08:00

README.md

Tilemaps Build status badge

This extension contains advanced APIs for working with tilemaps in blocks.

Usage

createSpritesOnTiles

The ||tiles.createSpritesOnTiles|| block creates an empty sprite on top of each location with the specified tile. Combine this with ||sprites.onCreated|| to initialize the empty sprites with an image, position, etc.

Parameters

  • tileKind is the image of the tile where sprites will be created
  • spriteKind is the kind of sprite that will be created

Example 1

Create a small green box on each empty tile.


sprites.onCreated(SpriteKind.Enemy, function (sprite) {
    sprite.setImage(img`
        7 7 
        7 7 
        `)
})
tiles.setTilemap(tiles.createTilemap(hex`0400040000000000000000000000000000000000`, img`
. . . . 
. . . . 
. . . . 
. . . . 
`, [myTiles.transparency16], TileScale.Sixteen))

tiles.createSpritesOnTiles(myTiles.transparency16, SpriteKind.Enemy)

Create a project with this extension

This repository can be added as an extension in Microsoft MakeCode.

Edit this extension

To edit this repository in Microsoft MakeCode.

Supported targets

  • for PXT/arcade (The metadata above is needed for package search.)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

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.