As you've seen, one the most powerful features of the p5play library is their Sprite object, a graphical object that has built-in programming properties and actions. These Sprites automatically interact with each other and their world as if they are in our physical world -- they collide, they bounce, they have friction, and they fall due to gravity. This is super helpful when wanting to create games and simulations!
The term sprite however, has been associated with video games as early as the 1970's. It is more generally defined as simply a 2d image that is often part of a larger scene. What you see as characters, objects, items, and UI elements in 2d games are all sprites! Check out all of the sprites in the two games below:
Sprite Animations
In most games, the sprites that players control or interact with are animated sprites. This creates a much more dynamic and interesting visual experience for the player.
The example below has two sprites that you can control. Click on the the canvas and then use the left and right arrow keys to move the top sprite and the "a" and "d" keys to move the bottom one.
Both characters are sprites, but the top sprite is animated so that it looks more realistic -- it bobs up and down while resting, and it walks when the player moves it! The animated sprite is a lot more fun, right?
You'll learn how to create animated sprites with the p5play library in the next few activities.