Working with Events in MakeCode Arcade

Kiki Prottsman
Kiki’s Corner
Published in
3 min readMar 25, 2024

When you think of events, you might think of basketball games, concerts, or even holidays…but in Microsoft MakeCode Arcade, events are specific things that happen while a program is running. Imagine if your character bumps into a treasure chest, or you press a button to make them jump; those are the kinds of events we use in the gaming world.

What’s the Big Deal with Events?

Events in are important in MakeCode Arcade because they make your game interactive and fun. Without events, your characters wouldn’t do much and your game wouldn’t feel like a “game”. But with events, every button press or character move can lead to awesome actions… like discovering secret items, battling enemies, or unlocking new levels.

How to Make Things Happen with Events

Let’s dive into how you can create cool events in your own games:

Sprites and Overlaps

Imagine you want your character to pick up a coin when they walk over it. In MakeCode Arcade, you can use an overlap event. This means you tell the game, “Hey, when my character and a coin touch, make something cool happen.” That something cool could be adding points to your score, playing a sound, or making the coin disappear to show it’s been collected.

Controller Buttons

What if you want your character to jump when you press a button? That’s where controller events come into play. You can program the game to respond to button presses on the keyboard or gamepad. Press the “A” button, and woohoo! Your character leaps over obstacles or bounces on enemies’ heads, just like in your favorite platform games.

Timers and Background Events

Some events are all about timing. With timers, you can create events that happen after a certain amount of time. Think of a cooking game where you have to heat a pizza for exactly five seconds. If you take it out too early or too late, it might not be as tasty! Timers help make games more challenging and realistic.

Testing and Tweaking Your Events

Once you’ve set up your events, it’s important to test your game and see how it feels. Sometimes, you might find that an event makes the game too hard or too easy, or maybe it just doesn’t work the way you expected. That’s totally okay! The best game developers spend a lot of time testing and tweaking their games to make them just right.

Share the Fun!

After you’ve created a game with some awesome events, don’t keep it to yourself! Share it with friends, family, or even your class. You can learn a lot from watching other people play your game, and you might get some great ideas for your next game project.

Wrapping Up

Events turn a bunch of code and sprites into an exciting game that people love to play. By understanding how to work with events in Microsoft MakeCode Arcade, you’re on your way to creating games that are not just fun to play but also cool to share.

What kind of amazing events will you come up with for your next game? The possibilities are endless, and the fun is just beginning!

--

--

Kiki Prottsman
Kiki’s Corner

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