• 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!

Legacy GM Slow object as it grows in size?

T

TheRBZ

Guest
I have a player object and I want it so that as it gets larger, it slows down

I've tried:
Setting 'movespeed' variable to a decimal (eg 0.5) but it causes jitter because you can't move half a pixel

putting my movement code in an alarm and changing the speed of that alarm, but the alarm ignores the following decimal (eg if I make it 2.5 it just acts as if it's 2) and the movement is laggy once the player gets too big.

First solution
Code:
///change speed based on radius
movespeed=5/radius

/*
radius=5, speed 1
radius=10, speed 0.5
radius 20, speed 0.25
*/
Second solution
Code:
*insert movement code here*
alarm[0]=(radius/5);
Are there any valid solutions? I'm thinking I could rescale everything (sprites, rooms, views) by x4 so the player can move '0.5 pixels, 0.25 pixels etc' at a time. Ideas?
 
D

dannyjenn

Guest
Try rounding the coordinates in the drawing code. That might reduce the jitter.
Are you sure you want the speed to be .5 or .25 though? That's extremely slow, which might be why the jitter is so noticeable.
 
T

TheRBZ

Guest
My base speed is 1 but because everything is as small as possible in my game, it looks pretty fast (for comparison, the view is 256x144)
 
Top