GameMaker Set timing action without Timelines. Code dont work Pls HELP..

S

SuG4Ru

Guest
Hi everyone, i have problem with some part of code. Shortly say. I want set time action [or duration [cooldowns] of abilities and spells] when i dont want use Timelines , but i have a problem with this. Here i try set the shifting mode not like a sprint but like a shifting fast move to direction with max distance .. ... But whan i tried a lot of times a difrent ways to achieve this but still not working. Please little help me with this.

Code:
kshift    = keyboard_check (vk_shift) ;

timecs         = delta_time / 10000 / room_speed  // 0,01 second
//(room_speed / room_speed) /100  ;//  (60 / 60) = 1 / 100 = 0,01 * 1 = 0,01 seconds  -- 500 = 5 seconds

shifting       = 0;

//----------Stats Numbers--------

normalspeed    = 10  ;  // global.normalspeed
movespeed      = normalspeed  ;
shiftspeed     = 4   ;  // global.shiftspeed
shiftcooldown  = 200 ; // global.shiftingcooldown

//____________________________________________________________________________________________

speed = 0

draw_text (x=50,y=50,movespeed)
draw_text (x=100,y=100,shifting)

//Shifting

if kshift
    {
    if shifting <= 0
        {
        movespeed = normalspeed * shiftspeed ;
        shifting  += 1   ;
        }
    else if shifting > 0
        {
        movespeed = normalspeed ;
        }
    }
if !kshift
    {
    movespeed = normalspeed ;
    }
if shifting >= shiftcooldown
    {
    shifting = 0 ;
   
    }
And text dont show on game ... Can someone say why ??
And if i add this article to bad thread please move to the write thread.
Thank you for read and very Thank You for answare. Have Good Day :) [my english terrible please dont punish me for this].
 
Top