Kiki’s Corner
Published in

Kiki’s Corner

Sprite Properties in MakeCode Arcade

This program randomly changes the “scale” property of the sprite

You may have already read my post on setting up sprites in MakeCode Arcade, but have you explored all of the that come along with Arcade sprites?

A sprite property is a feature or value that’s stored inside the sprite itself. These properties can be accessed or changed using code.

Default Properties

Arcade presents you with a long list of default properties that are associated with sprites. Things like x or y location, velocity, scale, and lifespan can all be managed using built-in setters and getters.

Example menu of sprite properties that can be managed

Custom Properties

Arcade also has an extension that will allow you to create your own custom properties on your sprites!

The arcade-sprite-data extension gives you the ability to add and manage your own data categories for sprites.

arcade-sprite-data extension
Various ways to add or manipulate data on a sprite, depending on the data type

Create a data property by “setting” the data label on the sprite, and give it a value. Then, you can manage that value the same way you would manage a score, life, or flag.

This program gives the ice cream a “licks” property and changes the size of the cone based on the number of licks.

This extension is also a great way to add HP or XP to players and enemies since Arcade has no explicit hit point counter built-in.

Click here to read more about setting lives, energy, and HP.

Give this extension a try. Is there anything you’re able to do now that you weren’t before? If so, let me know by leaving a comment below.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kiki Prottsman

Kiki is an author, educator, and the Director of Education for Microsoft MakeCode