I'm currently developing a game with 4 characters in the MV. I don't use the status system and what determines if a character died are variables. I am at an impasse to determine when a character is dead or alive, as in the future it could give a bug with the way in which the check is read. Basically, it checks if that switch is active, if not the code will check if another switch is active, so until it checks all the switches that determine if the character is alive or not. This in the future could generate an error in the code, where if a previous character was already dead it would not check if the others were still alive or not. I decided to move to variables so each character would be determined by a number in the variable (1234 would mean all characters are dead, 13 would mean only characters 1 and 3 are dead). But even then they would still be pretty bad, because I would have to do 16 checks for a single code. Could someone help me to optimize this system?
[btw, my english is very bad, then i used the google for translate all the text (srry the laziness). if u wanna ready the original text, here it is: V]
[btw, my english is very bad, then i used the google for translate all the text (srry the laziness). if u wanna ready the original text, here it is: V]
Atualmente estou desenvolvendo um jogo com 4 personagens no MV. Não uso o sistema de status e oque determina se um personagem morreu são variaveis. Estou num empasse para determinar quando um personagem está morto ou vivo, pois futuramente poderia dar um bug com a forma na qual a checagem é lida. Básciamenete, checa se tal switch ativa, se não estiver o código vai checar se outra switch está ativa, assim até checar todas as Switch que determina se o personagem está vivo ou não. Isso futuramente poderia gerar um erro no código, onde se um personagem anterior já estivesse morto ele não iria checar se os outros ainda estariam vivos ou não. Decidi migrar para as variaveis, assim, cada personagem seria determinado por um número na variavel (1234 significaria que todos os personagens estão mortos, 13 significaria que apenas os personagens 1 e 3 estão mortos). Mas mesmo assim ainda seria bem ruim, pois teria que fazer 16 checks para um único código. Alguém poderia me ajudar a otimizar esse sistema?