About
Simple extension that provides math and other utility functions for arcade makecode alongside exposing useful commands to blocks.
Whats implemented:
- PI – Allows you to retrieve the value of pi without manually typing it in.
- Distance Calculator – Allows you to calculate the distance between two positions.
- Angle Calculator – Allows you to calculate the angle between two positions.
- Radians – Converts a given angle to radians.
- Degrees – Converts the given radians back into degrees.
- Clamp – Limits a value within a specified range.
- RaycastTileMap – Raycasts in a direction to retrieve tile map data, such as whether a wall or sprite is within the area.
- Velocity – Calculates the velocity for a position using the provided speed and angle.
- Angle Position – Returns the new position based on a given angle, distance, and starting position.
- Show Stats – Makes helpful stats be avaible when using blocks.
- Show Debug – Makes the debug view that shows hitboxes and more avaible when using blocks.
- ShootLaser – Creates a line of sprites towards an angle intended to be used as a laser.
So now i don’t have to keep writing all these commands manually each time lol.
Use as Extension
This repository can be added as an extension in MakeCode.
- open https://arcade.makecode.com/
- click on New Project
- click on Extensions under the gearwheel menu
- search for https://github.com/thereal3rd/utilityfunctionslib and import
Edit this project
To edit this repository in MakeCode.
- open https://arcade.makecode.com/
- click on Import then click on Import URL
- paste https://github.com/thereal3rd/pixelutilsarcade and click import
Metadata (used for search, rendering)
- for PXT/arcade