Legacy GM whats a slow speed in code

G

guywithglasses

Guest
ive been trying to get a speed that is slow, in code but i never get the right speed.
i tried image_speed = 0.1
and image_speed = 0.25

and more. but i never got the right speed.
Please help :)
 

Yal

šŸ§ *penguin noises*
GMC Elder
What's your room speed? If it's 30, speeds are half as fast as if it's 60. Speeds are relative, there's no speed values that are intrinsically fast or slow... it depends of all the other factors of the game.
 
T

Tirous

Guest
In GameMaker, time is processed in discrete units known as "frames", with the amount of these frames passing per second being equal to the "room_speed" of the game at that time (don't ask what happens when you change room_speed mid-game, it's incredibly stupid yet also mostly harmless.)

All, or at least most, things that measure time count frames, so an image_speed of 1 means that it changes one image every frame, if you room_speed is 30, then it will change 30 times per second.

An image_speed of 0.5 will mean it will change 50% to the next image over one frame, what this means in practice is that it will sit on an image index for two frames before moving to the next, with this being due to the fact that when GameMaker actually picks which image to display, it does so by taking the image index and rounds it down to the nearest integer, thus you get the values 0, 0.5, and 1, becoming 0, 0, and 1, in practice, thus causing the wait.

This frame counting extends to all aspects of GameMaker. If you make an object move rightwards at a pace of 3, that means it's moving 3 units EVERY FRAME, and thus will move at exactly a rate of 3 * room_speed units per second.

It's a tad confusing at first, but it's important you get a solid understanding for this concept if you want to use GameMaker effectively. And especially if you want to go onto using other more complex engines like Unity and maybe even making your own custom game engine in something like C++, this is one of those pieces of knowledge that will only become more important to have as you progress.

That said, if my answer isn't clear enough for you, just say so, I'd be more than happy to ramble on with a few more examples if need be. :)
 
G

guywithglasses

Guest
What's your room speed? If it's 30, speeds are half as fast as if it's 60. Speeds are relative, there's no speed values that are intrinsically fast or slow... it depends of all the other factors of the game.
thanks i did not know that, i will do that
 
Top