
In pc graphics, a sprite is a two-dimensional bitmap that’s used to signify a personality, object, or different recreation aspect. Sprites are sometimes utilized in video video games and different graphical functions as a result of they’re comparatively straightforward to create and animate, they are often scaled and rotated with out shedding high quality, and they are often simply moved across the display. One of the necessary issues to be taught when working with sprites is methods to transfer them across the display. There are a couple of other ways to do that, however the commonest technique is to make use of the `x` and `y` properties of the sprite object. The `x` property controls the horizontal place of the sprite, and the `y` property controls the vertical place. To maneuver a sprite, you merely want to alter the values of the `x` and `y` properties. For instance, the next code would transfer a sprite 10 pixels to the fitting and 5 pixels down:
sprite.x += 10; sprite.y += 5;