Hi Andreas,
as for why it behaves like this, it would be easier if you sent more
code (especially the die method, where you declare age, etc). But
if I were you I'd totally rewrite that part anyway.
I remember that you asked about lookup tables, so you try to be
efficient. You likely want to
Also, when you
create them, you can give them a deathDate property you test time
against. That way you move part of the math to creation/death time and
not do it each frame when it can be avoided.
Plus, if they all live for the same time, you can even avoid the if
entirely by having them in a
It's ok to have die as a method because bullets don't die often. But
update should be called only once and then loop through the bullets,
not the other way round (looping through the bullets and calling
update on each). Same with checkEvents and move.
I'm not entirely sure how you intend me
This feels like going back to procedural programming again and it makes
me wonder why the hell i even bother making a Bullet class in the first
place if the amount of functionality i can give a class has to be
supplied in raving great lumps like this or little to none at all.
Hmmm... yeah...
4 matches
Mail list logo