So I’m building tower defense. However, due to sentry limits and the end of sentry interaction, the enemies literally have no real health. They only have psuedo health. The problem is, I need to have the health value
a) be associated with a specific enemy
b) scale with the rounds
c) shift to stay with the same enemy as the enemies move down the track
and meantime save as much memory as possible.
I’m confused how to do this.
That’s really hard to do. You just have to hope the player isn’t too good because if a prop dies, it’s dead forever. So you’ll need a system that allocates barriers as health to decides the health of each sentry entering.
Not props, literally textboxes with no health.
And they are damaged by textboxes.
It checks how many props have died, the amount of sentries left, the amount of sentries dead at that spot, and maybe other parameters.
Oh!!! So you mean you have a coordinate system?
Yes, I have a 9x9 built on your guide.
Ok. The towers are just barriers, right?
Do you already have the shooting down, or do you also need help with that?
Well, textboxes (monkey for like BTD) but yes
Not yet, I figure I need enemies first.
Ok. So you have a set amount of enemies per round. Then, you use an accuracy function to make the shot. Then, if the accuracy function picked the correct line, then the game decides that the tower hits the text. And you need a text display to show the shot.
But for now, the issue is the health. Of course, with a player you just have the property have the scope of player. But there’s no scope option for non-players.
So that means (as far as I understand) that I will need a property for each enemy that I have, right?
(By the way, I am using ~64 properties right now. Property limit coming up fast.)
Shameless outlet for PCPs. Increases limit to >600 properties.
ok, I’ll remember that if I run out
Is this still a thing you need help on?
From what I’ve read, it sounds like you’re just gonna need to seperate visuals from actual health. They can’t damage each other directly (since they’re just text boxes), so adding some animations and then having them die by proximity, maybe a calculation system to shoot shots if you want to make it realistic.
Yes, I was still needing help.
I still need to know how to carry over a value as it moves down the track. I have each track spot having a health value, with 0 being empty. I want to use the value 1 for a red, 2 for a blue, and maybe I’ll get to yellows. Based on that number, I can show a graphic and make towers ‘fire’ at it.
That has a couple limitations. For one, you can only have one thing per spot. Is that ok?
Second of all, carrying the value over would be super easy with a for loop, but of course we don’t have those. It seems like the best way to do it is to just brute force it.
Also, I would recommend switching over to a different method of storage, like using OOP to have an object for each enemy. How much variance do you want in the enemies?
Either way, there’s gonna be a cap on something, because we don’t have all of the useful tools.
You just multiply by 3 and truncate in variables to store in properties instead of a for loop.
One per spot is fine.
If you have played Bloons Tower Defense, you know that they get slower the lower they are. The health, speed, and color are all I need for variance.
Also, can you explain how to apply OOP to this?
OOP’s never really been made or been implemented, as of my knowledge.