Game Development Community

Stamina? (Sprint with limit)

by Orion the Hunter · in Torque Game Builder · 10/21/2012 (10:52 am) · 1 replies

Hi,

I didn't know if this should be in the PSK section or the TGB section so I played it safe and put it here. ;)

I'm thinking of a way to give the player a sprint ability. He moves faster, but if he sprints for too long, hje gets burned out and walks slower than he did before and is unable to jump. Does anyone have something like that?

#1
10/21/2012 (11:39 am)
Have a "stamina" property on the player object. Use a schedule loop to keep track of the dash status: When dashing, make the value go down; when not dashing, make the value go up; if stamina is 0, lock the player's maximum speed.