Giter Site home page Giter Site logo

microsoft / pxt-tilemaps Goto Github PK

View Code? Open in Web Editor NEW
6.0 9.0 6.0 967 KB

MakeCode Arcade extension for handling multiple tilemaps and extra tilemap blocks - beta

Home Page: https://microsoft.github.io/pxt-tilemaps/

License: MIT License

Makefile 0.18% TypeScript 99.82%

pxt-tilemaps's Introduction

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 [email protected] with any additional questions or comments.

pxt-tilemaps's People

Contributors

darzu avatar jwunderl avatar microsoft-github-policy-service[bot] avatar riknoll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pxt-tilemaps's Issues

Tile at [location] is [tile] loses tile preview

After reloading the /beta editor, the tile at [location] is [tile] block loses the preview.

Here's a screenshot of the block:

Screen Shot 2020-05-27 at 9 26 30 PM

... and the corresponding JS:

Screen Shot 2020-05-27 at 9 32 34 PM

The code runs correctly; it appears to be just the tile preview that is broken.

You can't assign 'tilemap1' and 'tilemap2' to variables.

I don't know how to use the "connect (tilemap1) and (tilemap2) blocks to actual tilemaps. Instead, you can change the block to "Connect (tilemap) and (tilemap) with door going from X Y Z to X Y Z?" I don't know if this would be difficult to do, considering that this completeley changes the code block and may mess up some people's code, but if you could make it that would be cool! Thank you.
(P.S, the (tilemap) I refer to in this is the one used in the "set tilemap to (tilemap)" one.

"Copy tilemap" doesn't copy walls

When getting a copy of a tilemap to not alter the original whenever you manually set a tile, it does not take into account wall configuration, and every wall placed/removed applies to the original tilemap which was copied, as opposed to just the copy.

Fix README

it's just copy and pasted from my old overworld extension.

Able to "paste" tilemaps onto each other

A block maybe that would iterate over every tile in a tilemap that is passed in, and it would set it in the current tilemap. So then you don't need a hundred "set tile at location" blocks to "generate" stuff.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.