GithubHelp home page GithubHelp logo

riknoll / arcade-sprite-events Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 234 KB

An extension for MakeCode Arcade that adds more Sprite events

Home Page: https://riknoll.github.io/arcade-sprite-events/

License: MIT License

Ruby 0.28% Makefile 0.26% JavaScript 1.23% TypeScript 98.23%

arcade-sprite-events's Introduction

MakeCode Arcade sprite events extension

This extension adds a few blocks to MakeCode Arcade that give you events you can use with sprites and tilemaps.

Here's a quick sample of the events that are available:

Tilemap events

This event block gives you a lot of events that are useful when using tilemaps. Here's an explanation of all of the different sub-events:

  • starts overlapping - runs once when a sprite starts overlapping with any tile that has the given image
  • stops overlapping - runs once when a sprite stops overlapping with any tile that has the given image
  • fully within - runs once when a sprite is fully within a tile with the given image (i.e. it's only overlapping with one tile and that tile is the selected one)
  • no longer fully within - runs once when a sprite that has been fully within a tile with the given image starts overlapping with another tile
  • fully within area covered by - runs once when a sprite enters an area where it is only overlapping with tiles that have the given image. Very similar to the "fully within" event but it will run even if you're overlapping with multiple tiles as long as they are all the same kind
  • no longer fully within area covered by - runs once when a sprite is no longer fully within an area covered by tiles that share the same image

Sprite events

This event block gives you more options for the standard sprite overlaps block. They are:

  • starts overlapping - runs once when a sprite starts overlapping with another sprite of the given kind
  • stops overlapping - runs once when a sprite that has been overlapping with another sprite of the given kind is no longer overlapping with them

Region events

Region events let you register events that run when a sprite enters or exits a certain part of the game world. In addition to using tilemap locations, you can also define regions using pixel coordinates. The different events are:

  • starts overlapping - runs once when a sprite starts overlapping with a region
  • stops overlapping - runs once when a sprite stops overlapping with a region
  • fully within - runs once when a sprite fully enters a region
  • no longer fully within - runs once when a sprite is no longer fully within a region

Use as Extension

This repository can be added as an extension in MakeCode.

Metadata (used for search, rendering)

  • for PXT/arcade
<script src="https://makecode.com/gh-pages-embed.js"></script><script>makeCodeRender("{{ site.makecode.home_url }}", "{{ site.github.owner_name }}/{{ site.github.repository_name }}");</script>

arcade-sprite-events's People

Contributors

riknoll avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

arcade-sprite-events's Issues

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.