• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code [SOLVED] Non-animated sprites with multiple frames

Z

ZombieTom

Guest
I have a sprite, spr_tile_hillSlope_downUp. The sprite has three frames.

In the code, the sprite is created using:
Code:
layer_sprite_create(layer1Obstacles, tile_x, tile_y-(sprite_get_height(spr_tile_obs_wall)-global.tileHeight), spr_tile_hillSlope_downUp);
In the game, the sprite is created fine but it automatically starts animating through it's three frames.

Is it possible to create the sprite so it does not animate - ie. it stays at image_index 0 until manually changed to image index 1 and so on? I can get round this issue simply by using a seperate sprite though it would be nice if I could keep all sprite "sub-images" in one sprite resource.
 

Mick

Member
Like this I guess:

Code:
var spr = layer_sprite_create(layer1Obstacles, tile_x, tile_y-(sprite_get_height(spr_tile_obs_wall)-global.tileHeight), spr_tile_hillSlope_downUp);
layer_sprite_speed(spr, 0);
layer_sprite_index(spr, image_index_of_your_choice);
 
Top