Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

Premium Features

Download Video

End game fireworks

Published 4 months ago

This video recommends brushing up on some circular geometry topics. You can learn about them, in-depth, with my video on circular motion here: https://chriscourses.com/courses/canvas-physics/videos/circular-motion

The end of classic Mario games contain a celebration laden with fireworks as you complete a course and slide down the iconic flagpole. Here we'll learn how to create our own dynamic fireworks using our particle class and make sure they occur in exactly the right spots whenever we complete our game.

Here's a step-by-step checklist you can use to help develop this feature:

  • When Mario is at bottom of flagpole, determine firework count

  • Create for loop

  • Push new particles positioned in center of screen

  • Add red color to particles to start

  • Add randomized velocities

  • Code velocities so they expand in circular fashion

  • Randomize colors

  • Fade particles

  • Iterate through setInterval to create three bursts

  • Clear interval

Comments

Want to participate?

Create a free Chris Courses account to begin

Login

No comments yet, be the first to add one

Cheat Sheet Preview

Download The Official Chris Courses HTML5 Canvas Cheat Sheet

Essential canvas syntax at your fingertips.

Download Now

Providing the lift to launch your development career

© 2022 Chris Courses. All rights reserved.