Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Gamemaker Essentials
  • Table Of Contents Toc
  • Feedback & Rating feedback
Gamemaker Essentials

Gamemaker Essentials

3.8 (13)
close
close
Gamemaker Essentials

Gamemaker Essentials

3.8 (13)

Overview of this book

This book is for users experienced with game development who now want to learn how to develop games in GameMaker: Studio in a fast-paced way.
Table of Contents (11 chapters)
close
close

Sprites in the GameMaker Language


When it comes to making games with animation, it is extremely common for the animation to need to stop or change when an event happens. For example, the player pressing the right arrow key may make the game change the character's animation to a running animation.

You will learn to do this through programming using GameMaker Language in a new object.

Every object in GameMaker has a set of variables that allow users to control what sprite an object has linked to it, as well as the animation speed, current frame, and more.

Setting an object's sprite

The sprite_index variable defines which sprite the object currently has set to it. Changing this variable will change the object's sprite.

The following is the example code:

sprite_index=spr_player;

Getting the width and height of a sprite

The sprite_width and sprite_height variables return the width and height of the sprite currently linked to an object. This becomes useful when positioning text or other things around...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Gamemaker Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon