CesarZ
Well-Known Member
- Joined
- Sep 20, 2012
- Messages
- 272
- Solutions
- 4
- Reaction score
- 66
if my code is.
my Goal here is to save as much memory and dump all trash if they aren't being use on any of my projects with JavaScript. I'm trying to understand how it works when it comes to memory use.
i don't know if BEFORE i pop the monster out, i should pop that "New Outfit" class out of there and then pop the monster out.
I don't know if you all get me or i have to explain my self better. let me know your thoughts thanks
LUA:
class Monster{
constructor(health, level, outfit){
this.m_health = health,
this.m_level = level,
this.m_outfit = outfit,
this.m_outfit = New Outfit(outfit);
}
}
//My question is....
//If i place a monster on the map of my game.
const Monster_placer = [
New Monster(100, 30, 2)
];
//if i delete one by using
this.Monster_placer.pop(1);
//Would it also delete that class that says
New Outfit(outfit);
//located inside that Monster class?
my Goal here is to save as much memory and dump all trash if they aren't being use on any of my projects with JavaScript. I'm trying to understand how it works when it comes to memory use.
i don't know if BEFORE i pop the monster out, i should pop that "New Outfit" class out of there and then pop the monster out.
I don't know if you all get me or i have to explain my self better. let me know your thoughts thanks