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
Second solution
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?
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
*/
Code:
*insert movement code here*
alarm[0]=(radius/5);