Video Thumbnail

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


Premium Features

Download Video

Dynamic Score Labels

Published 2 years ago

It would be nice to know the exact score we get from shooting each invader. This lesson will teach you how to create a "dynamic score label" that appears, then animates out whenever you shoot an invader. It creates for a really cool effect and immediately makes your game start to stand out compared to before.

The checklist for this feature is as follows:

  • Create score label with document.createElement(label)

  • Append to DOM with document.body.appendChild(score)

  • Change element's innerHTML

  • Change style for position, color, top, left, and userSelect

  • Call for animation

  • On complete, get parent node and call removeChild()

GSAP Documentation:


Want to participate?

Create a free Chris Courses account to begin

SPURTECH posted 2 years ago
chris posted 2 years ago

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.