Jump to content


Photo

Making a sprite NOT animate


  • Please log in to reply
7 replies to this topic

#1 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 13 April 2012 - 08:15 PM

This has got to be something simple I'm not able to see.

I have a sprite with multiple sub images, I am randomly choosing a sub image when it spawns,

How can I set it so it does not auto animate to the next sub image?
  • 0

#2 graves23

graves23

    Artist Solo Queue

  • New Member
  • 35 posts
  • Version:GM8

Posted 13 April 2012 - 08:18 PM

Save the random sub image into a variable.
And then put Code :
sprite_index = Variable

Edited by graves23, 13 April 2012 - 08:18 PM.

  • 0

#3 Cpt Chuckles

Cpt Chuckles

    GMC Member

  • GMC Member
  • 312 posts
  • Version:GM8.1

Posted 13 April 2012 - 08:18 PM

image_speed = 0;
  • 0

#4 TGCL

TGCL

    GMC Member

  • New Member
  • 74 posts
  • Version:GM8

Posted 13 April 2012 - 08:18 PM

Change image_speed :D
  • 0

#5 Lightang3l

Lightang3l

    GMC Member

  • GMC Member
  • 851 posts

Posted 13 April 2012 - 08:21 PM

First you set the image_speed to 0 and then you give it a random image_index NOT sprite_index as graves suggested...

Cheers...

EDIT : typo

Edited by Lightang3l, 13 April 2012 - 08:22 PM.

  • 0

#6 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 13 April 2012 - 08:22 PM

Change image_speed :D


Ugh for fracks sake - DUH. I knew that. Maybe it's time for bed.
  • 0

#7 Haxman2

Haxman2

    GMC Member

  • GMC Member
  • 7 posts
  • Version:GM8

Posted 13 April 2012 - 08:31 PM

This has got to be something simple I'm not able to see.

I have a sprite with multiple sub images, I am randomly choosing a sub image when it spawns,

How can I set it so it does not auto animate to the next sub image?

If you still need it:

Create Event of your object:
image_index = irandom(5) //chooses a random number from 0 to 5.
image_speed = 0;

  • 0

#8 TerraFriedSheep

TerraFriedSheep

    GMC Member

  • GMC Member
  • 2822 posts
  • Version:GM:Studio

Posted 13 April 2012 - 09:19 PM

Just as an extra note, image_speed is another one of those variables that exists in every object. It is basically the value that is added onto image_index every step, so an image_speed of 1 will change the sub image every step, whereas an image_speed of 0.25 will change the sub image every 4 steps. To change the sub image every second, you would use image_speed=1/room_speed;, and if you start using image_speed's greater than 1, the animation will start skipping sub images, so ideally you want to set the image_speed to a value between 0 and 1.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users