LuciusVH Posted December 16, 2021 Posted December 16, 2021 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.
Solution PointC Posted December 16, 2021 Solution Posted December 16, 2021 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. 4 1
LuciusVH Posted December 16, 2021 Author Posted December 16, 2021 Yeaaay amazing!! Thanks for your help I have a feeling that I'm gonna love GSAP ? 2
_Greg _ Posted December 17, 2021 Posted December 17, 2021 Hi! Off-topic (!NOT about GSAP): About counters watch video from "google chrome developers" chanel, they say about all problems with counters in one video They create optimal solution 1
OSUblake Posted December 17, 2021 Posted December 17, 2021 But if you're using GSAP, you wouldn't need to worry about that because GSAP accurately handles time. 3
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now