Closed robkruger closed 4 years ago
Projectile
👍 but is a tracer a projectile?
Yes, It's a type of bullet
@robkruger: you suggest to use inheritance here with 'Projectile' as the base class. I strongly advice against it, as inheritance is hard to use correctly and easy to use incorrectly :rainbow: .
An easy alternative is to use a 'Projectile' class, with an enum type called 'type'. This is the approach we used in Nature Zen. It is simple and scales better (i.e. it prevents a class explosion).
OTOH, the problem is simple enough to try it out in this context, as it will be relatively easy to undo at the moment Team Octane regrets the decision to use it.
I leave it up to you (or the whole Team) to pick either:
@richelbilderbeek I meant the Nature Zen approach, but maybe didn't explain it too well...
Cool, than you have my complete blessing! Good luck implementing it :+1:
I'll create a projectile system with enums. It'll be a bit more complex so I'll remove the good first issue label.
I created a projectile system & merged.
Currently, the machine gun nests shoot shells, which isn't realistic of course. We need new bullets.
Create a enum class named
ProjectileType
, addshell
,bullet
andtracer
in there and rename theShell
class toProjectiles
. Modify that class so that it has a variable which holds it's type and it has a custom texture for all the bullet types. Another option, although less efficient, is to create a new class namedBullet
and copy almost all the code from the shell class but with another texture.