The 5-Second Trick For Dino Game 81
During the constructor for cactus, we accept the location and just randomly opt for a sprite from a predefined list of cacti.We want our frame to change just about every 100 milliseconds, which is why we’re dividing elapsedTime.inMilliseconds by 100. This division will give us a double and we have only integer body figures so we use floor() to tr