D
Dannyinformal
Guest
Hey lads,
So I'm making a small Metroidvania game for kicks and laughs. I made a boost/sprint key modifier (shift) which bugs out. I was wondering if you guys could help me out. This is what happens:
1. You start with 20 boost power
2. When you press right + boost you dash and the boost power gradually decreases
3. Sub 20, it slowly regenerates
In point 3 lies the problem; the boost power regenerates, but stops regenerating the moment i press right, een without pressing the modifier. This is my code:
Thanks for your help lads!
So I'm making a small Metroidvania game for kicks and laughs. I made a boost/sprint key modifier (shift) which bugs out. I was wondering if you guys could help me out. This is what happens:
1. You start with 20 boost power
2. When you press right + boost you dash and the boost power gradually decreases
3. Sub 20, it slowly regenerates
In point 3 lies the problem; the boost power regenerates, but stops regenerating the moment i press right, een without pressing the modifier. This is my code:
Code:
if obj_gegevens.boost > 0 && keyboard_check (vk_right) && keyboard_check (vk_lshift) //when you press shift and right DASH
{
x += 20;
image_speed = 1;
obj_gegevens.boost -=1;
}
if obj_gegevens.boost < 20 && !keyboard_check (vk_right) && !keyboard_check (vk_lshift) //when you DON'T press shift and right, regenerate
{
obj_gegevens.boost +=0.2;
}