Simple Usage Examples
Creating a Player Sprite
The following code is an example of using Create Sprite to create a sprite of a 2D game character and draw it on a SplashKit window.
Output:
Drawing a Player Sprite
The following code is an example of using Draw Sprite to create a sprite of a 2D game character and draw it on a SplashKit window.
Output:
Freeing a Sprite
The following code is an example of using Free Sprite to free a sprite when the UP
key is typed and after the window is closed.
Output:
Setting Sprite Position
The following code is an example of using Sprite Set Position to set a new location of a Sprite on a SplashKit window.
Output:
Setting Velocity of Sprite
The following code is an example of using Sprite Set Velocity to set a small horizontal velocity (moving to the right) for a sprite on a window.
Output:
Setting Sprite x-coordinate
The following code is an example of using Sprite Set X which sets the x-coordinate of a Sprite on a SplashKit window.
Output:
Setting Sprite y-coordinate
The following code is an example of using Sprite Set Y which sets the y-coordinate of a Sprite on a SplashKit window.
Output: