[Python] How i can create a bullet regeneration bar in python/ursina engine?

Discussão em 'Python' iniciado por Stack, Junho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I want to make a bar that shows a variable like bullet regeneration time. and i know that to do this i need to change the scale parameter given to Entities.

    But when i tried to change the scale parameter, bar's scale is increasing in two ways.I watched some tutorial but it didnt worked for me. There is my code:


    if mermiat == False and mertim >= 0.5:
    mermiat = True
    mertim = 0

    elif mermiat == True and mertim >= 0.5:
    mertim = 0

    if mermiat == True:
    BulletBar.scale_x = 12

    if mermiat == False:
    BulletBar.scale_x = mertim * 24

    Player = Karakter()
    BulletBar = Entity(model = "quad", position = (-13,-9,-2),scale=(12,0.5,1), color="FFFF00")

    """
    Notes:
    mermiat: bool variable to shotting bullets. If it is True, Player can shot Bullets.
    mertim: timer for shotting bullets. It blocks spawning bullets.
    Karakter(): Player class

    in the player class(Karakter) mertim is updating.
    If blocks is in the Player class(Karakter), at the update function.
    """


    Im new at python coding. That will be a simple problem.I apologize for wasting your time.Thank you in advance to those who read and help.

    Continue reading...

Compartilhe esta Página