How to make Health bars in Algodoo
HTML-код
- Опубликовано: 15 июл 2024
- check out my channel: / @leolimarblerace4391
into: (0:00)
Part 1 Connecting the marble and Health bar: (0:18)
Part 2 Making the Health bar display statistics: (1:54)
Part 3 Fixing the Health bar's position: (4:15)
Part 4 Turning this into a real marble race: (5:56)
outro: (8:12)
For the health bar, here is an alternate method:
postStep =
(e)=>{
pos = [_min + ((_max - _min) / 2.0) / _maxHP * _currentHP, pos(1)];
size = [_size / _maxHP * _currentHP, 0.25];
colorHSVA = [120 / _maxHP * _currentHP, 1 , 1 , 0.5];
}
_min is the left x position of the HP bar. If you don't know what that means, just take the *x pos - x size / 2.0*
_max is the right x position of the HP bar. If you don't know what that means, just take the *x pos + x size / 2.0*
_size is the x size
_maxHP is the maximum HP
_currentHP is the current HP
Note 1: x size means the first index of the size. Like if size is [-5, 16] then x size is -5 and y size is 16
Note 2: if your max HP is say 100, make sure to put _maxHP = 100.0. There is a weird thing in algodoo that if you do 31/10 it will return 3 instead of 3.1. To fix this, you need to do 31/10.0
:)
how are you so good at scripting?
...
@@CyanBeast01 uhm
Perfect script
Thanks for the tutorial brother
You can hack for bars
tysm!! i learned how to make a tuna fish game with this method! ps i subbed!
Thanks for tutorial
Nice tutorial
Bro this guy deserve more subcribe then this!
6:15
i had no idea how to code and this didnt help me much, tysm! im subbed! i even learned how to make a tuna fish game with this method! :D
_
;
'promo sm'