Psuedo Health for Textboxes [and other mechanics for tower defense]

What does this look like in blocks or whatever?

1 Like

I’m going to condense the finding the digit part because I’m on mobile. Basically you multiply by 3 before anything happens with text. Next, you loop through each digit in the number to add an emoji to the text property.

Why an emoji? [Also, going AFK for 20.]

1 Like

You’re using text right? It doesn’t really matter. I just thought you’d use emojis.

There’s no built-in for loops, but in an ideal world we could say:

for i in spaces:
    spaces[i+1] = i

or something like that, which basically iterates through each space and moves the things forward. But we can’t do that, so some other method of storing the data is probably much more efficient.

i just coded tetration on a ti-84 :smiley:

But why text and not numbers? I still don’t get it…
[also yes, I do know what a for loop is and how to code one in python]

1 Like

So you’re just using numbers as the enemies?

the enemies are numbers. I thought that those are better due to things like counters and checkers that can save me trouble later.

1 Like

Oh. That makes it way easier then. Just multiply the number by 3 each tick and truncate it.

How do I use the for loop to carry over values?

1 Like

You don’t need a loop because it’s a cool number theory trick. You basically add a 0 to the end of the number by multiplying by the base.

but how does this help me efficiently carry over values?

1 Like

I’m assuming you’re encoding the data in base 3.

Wdym?

Why base 3?

[Remember, the reason we were doing this was for carrying over values from one property to another.]

[I also just had the thought that actually it might be good to have more than one thing per space.]

1 Like

I have no clue about this, but maybe use channels, like have a group of sentry’s for each round, then divide them into health groups. after that, try connecting each health level to one channel. Like I said, I have no idea if this could work .

Thanks for trying to help, but I already ruled out sentries because they cannot move, take a lot of memory, and there is a sentry limit. I would have to use gadgets to damage them, and that also takes too much memory.

3 Likes

Ok, so now I understand why to use base 3, but I want to use base 5 because reasons. Does that mean I would multiply by 5 then cut off the end?

im sorry i couldnt help.

1 Like

Yeah, that’s how it works. But I have reservations about base 3, or any non-10 base, due to converting it back to base 10 to display the number.

1 Like