chronicleroflegends
Member
I have noticed an issue with my projectiles when I move from one screen to another in 4.1.
To prevent lag, I make it where the player can only have a max of 2 projectiles on screen at once.
The problem is ff I leave the screen while the projectile is still moving (not collided with a monster or solid) I lose the projectile forever, it never updates my variable to say the projectile is usable again.
I actually think I know a good fix for this, just not sure where to place it.
Since obviously you are not going to have already created a projectile before you enter a new screen, I was thinking of adding a small bit of code to whatever controls screen transitions to reset the variable to 2 every time you enter a new screen.
Looking at the screen code it looks like this may be handled by multiple scripts though. Any advice over where the best place to put this would be?
I want to reset the projectile count whether the player walks from one screen to another or teleports.
To prevent lag, I make it where the player can only have a max of 2 projectiles on screen at once.
The problem is ff I leave the screen while the projectile is still moving (not collided with a monster or solid) I lose the projectile forever, it never updates my variable to say the projectile is usable again.
I actually think I know a good fix for this, just not sure where to place it.
Since obviously you are not going to have already created a projectile before you enter a new screen, I was thinking of adding a small bit of code to whatever controls screen transitions to reset the variable to 2 every time you enter a new screen.
Looking at the screen code it looks like this may be handled by multiple scripts though. Any advice over where the best place to put this would be?
I want to reset the projectile count whether the player walks from one screen to another or teleports.