From the course: Coding for Visual Learners: Learning JavaScript from Scratch
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Animating text - JavaScript Tutorial
From the course: Coding for Visual Learners: Learning JavaScript from Scratch
Animating text
- [Instructor] Next, I will make you so that the text will grow in size during its lifetime to add some dynamism to the game. Doing so will be easy because I already have my guess item class, so it will be a small adjustment inside this class. What I'm going to do is I'm going to introduce this new property called scale increments, which is going to be equivalent to one initially, and after each time this text is being displayed here, I'm going to make the scale grow larger with the scale increments value. You might want to play with the value of the scale increments to be able to change the timing and the motion of the scaling animation because right now it might look a little bit too aggressive. So I will make it 0.5 to have it grow a little bit slower. And then the other thing that I will be doing is I will actually change the opacity of the color of the text, as well, as it is being animated. So to be able to do so I'm…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.