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)

Комментарии • 16

  • @CyanBeast01
    @CyanBeast01 Год назад +3

    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
    :)

  • @IrwinEthanRotil300
    @IrwinEthanRotil300 Месяц назад

    Thanks for the tutorial brother

  • @Lilacmymy7
    @Lilacmymy7 Месяц назад

    You can hack for bars

  • @liBlanca-ii7ve
    @liBlanca-ii7ve Год назад +1

    tysm!! i learned how to make a tuna fish game with this method! ps i subbed!

  • @Namsterste
    @Namsterste 4 месяца назад

    Thanks for tutorial
    Nice tutorial

  • @vuongnguyenminh4368
    @vuongnguyenminh4368 Год назад

    Bro this guy deserve more subcribe then this!

  • @roadto5000subs
    @roadto5000subs 9 месяцев назад

    6:15

  • @liBlanca-ii7ve
    @liBlanca-ii7ve Год назад

    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

  • @davidulisescarreonyee5619
    @davidulisescarreonyee5619 6 месяцев назад

    _

  • @davidulisescarreonyee5619
    @davidulisescarreonyee5619 6 месяцев назад

    ;

  • @wilbertsohrweide9405
    @wilbertsohrweide9405 Год назад

    'promo sm'