FR

Réalités Parallèles

Ergonomie et conception de jeu vidéo

Gamemaker Studio Horizontal Shooter - Basics - Creating sprites

Creating sprites for a player character

Sprites are the images that will be shown in the game. By itself, a sprite is just an image, but it can then be used by other things in the game to give them an appearance.

Let’s create a sprite for your player character.. Right click on the sprites folder and select “Create sprite”.

Screenshot

Setting up a new sprite

Screenshot

Click Edit sprite to create the art for the sprite directly in Game Maker for now.

Screenshot

Pick a size.

Screenshot

Blank image is added, double click to draw on it.

Screenshot

Draw your sprite. i’m making a rouhgly ship shaped triangle. You could go with basic geometrical shapes or draw a nice pixel art vessel or anything else. Just make sure it faces right, because that is the default direction it will be pointing towards once we use it in the game.

Screenshot

Save with green check icon.

Screenshot

Back in the sprite editor, you see your art now in image_0.

Save with green check icon again

For our purpose, we want to set the Origin to center. This defines the pivot point around which your ship would rotate.

Screenshot

Modify the sprite’s mask

The mask is the part of the image that’s used to detect collisions. Precise means the collision will be precise, but it takes more processing power. Using an ellipse or rectangle that matches your art as closely as possible is better, as it will keep your game running faster. Since you can’t match the shape perfectly, it’s usually better to stay inside the drawing. This is because players are more likely to be ok with imprecision if it goes their way: better to not lose a life when hitting an enemy, than losing a life when it visually looks like you didn’t get hit. To do so, set the mask to manual and use rectangle or ellipse. Drag and drop the shape on top of your drawing to get the best fit you can.

Screenshot

This is common in commercial games too and can be used to create a unique gameplay style. For example, in bullet hell shooters, the hit box is much smaller than the ship, and can be as small as a single pixel in the center.

Practice

In this example, I’ve created a player ship. Try making a 6464 pixels asteroid sprite, and an 88 bullet sprite. Screenshot

Example solution

Asteroid result

Screenshot

Asteroid collision mask

Bullet result

Screenshot

Bullet collision mask

Screenshot

Posted by Cornelia on 2021-04-01. Last updated on 2021-03-05

Articles on similar topics

Game Maker Studio tutorials

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Creating a room

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Creating a player character

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Prevent the player from leaving the screen

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Gamemaker Studio Horizontal Shooter - Basics - Scrolling backgrounds

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,

Game Maker Studio tutorials

Game development tutorial, Gamemaker development tutorials, Game Maker studio programming, Programming video games for beginners,