Game Development Community

A strange variable

by John · in Technical Issues · 07/12/2011 (9:08 pm) · 5 replies

Hi fellas did you remember this variable runEnergyDrain = 0.02;why when runEnergyDrain as 0.02,the energy of the player will lost so slow?and why when it equal 0.01 or 0 the energy never lost?

#1
07/13/2011 (9:56 am)
Because it is countered by rechargeRate, which is giving back x amount of energy at the same time.
#2
07/13/2011 (8:09 pm)
I have hard to understand ,what is rechargeRate and how it counter runenergyDrain?
#3
07/14/2011 (9:14 am)
rechargeRate is another datablock property. When a player is added to the scene it begins to recieve x amount of energy every tick - constantly recharging his energy.

runEnergyDrain is only applied when running.

This is can result in a little to no energy loss, or can quickly deplete energy depending on the various settings.

#4
07/14/2011 (11:12 am)
I try to give the %obj.setRechargeRate(); diffrent parameter,I find the spped of regained energy will slow or fast is it right?
#5
07/14/2011 (11:58 am)
Another things you should me need know is funny and stranger also,I %obj.setImageTrigger(0,true);when player died,the corpse still can
display in a few time why?And did you knowing what is "main weapon
trigger"?(In the author's comment)