abraker95 / tanks

2D arcade top-view shooting game
1 stars 0 forks source link

System(s) still update components belonging to an entity #39

Closed ghost closed 9 years ago

ghost commented 9 years ago

I put a debug printout for when an entity is created, and found that even though the tank is supposedly destroyed, it still created bullets. That tells me that there is still something with the indicated components in the environment being updated by the input system. Another thing, I couldn't locate the code where the bullet destroys the tank so I am not sure if the problem is even focused on the previously said.

ghost commented 9 years ago

I noticed 2 problems.

  1. The tank who shoots the bullet destroys itself with its own bullet
  2. There is no cooldown for the firing, so a lot of bullets are fired at once
ghost commented 9 years ago

Actually as you said there is no code that destroys the tank but too many bullets are generated and the the environment can't handle that so it overwrites the tank entity. The max number of entities was 32 but I will rise this number.

ghost commented 9 years ago

I fixed the problem.

Using the gun component in Tank- projectile componet in Bullet.