Jump to content
Search Community

Simple countdown not working

LuciusVH test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

Hi! 

 

It's probably going to be very obvious lol but I am new here, and pretty new to coding too. 

 

I am building a game and trying to make some countdown, from 3 to 0, before the game actually starts. 

 

See the CodePen to get what I have done so far. Not working as intented, who would've guessed 🤣

 

The effects are what I am looking for, sorta, but it does display only 1, then 1, then 1... Not 3, 2, 1 😔

See the Pen jOGmNVw by LVH75 (@LVH75) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @LuciusVH :)

 

Welcome to the forum.

 

When you call a function like that, you need to use onStartParams. You'd have something like this:

onStart: countdown, onStartParams:[3]

Loops and repeats can be quite helpful for something like a countdown. Here's another way to approach it. Maybe it'll give you some ideas.

 

See the Pen mdBmdMB by PointC (@PointC) on CodePen

 

Happy tweening and welcome aboard.

:)

 

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...