This project has been created before I started.
I worked with 2 other people at the project last semster (Fall Semester 2014).
So now Spring Semester 2015 I work on my own, refining it, fixing bugs and adding new features.
Upgrades until now:
- Towers inherit from turrets now.
- I set the model for the tower ad a cretain position and then place the turret (actual shooting thing) on the same place without a mesh (so it can move without the tower moving in all the directions)
TowerDefense
Moderator: PPS-Leaders
Re: TowerDefense
I like it that you use the turrets. Re-using existing code is always a good idea ![Wink ;)](./images/smilies/icon_e_wink.gif)
I don't know the code, but when I think about a tower, I think that it is responsible for two things:
I think that this could also help to adress the issue with the tower's movement. You have a static tower (a) with a movable turret (b) mounted on top of it.
Of course you could implement both concerns in one class, but the design principle of 'separation of concerns' implies that it's often better if you use more than one class. This way it's easier to understand and modify the code. And maybe sometimes you want a tower which has a completely different implementation of (b), e.g. a land mine which explodes if an enemy steps on it, while the implementation of (a) is still the same. It you use SoC it's easier to do that because you only need to re-implement (b).
![Wink ;)](./images/smilies/icon_e_wink.gif)
I don't know the code, but when I think about a tower, I think that it is responsible for two things:
- being placed somewhere, maybe being moved, having a cost, a level, etc
- shooting at enemies
I think that this could also help to adress the issue with the tower's movement. You have a static tower (a) with a movable turret (b) mounted on top of it.
Of course you could implement both concerns in one class, but the design principle of 'separation of concerns' implies that it's often better if you use more than one class. This way it's easier to understand and modify the code. And maybe sometimes you want a tower which has a completely different implementation of (b), e.g. a land mine which explodes if an enemy steps on it, while the implementation of (a) is still the same. It you use SoC it's easier to do that because you only need to re-implement (b).
Fabian 'x3n' Landau, Orxonox developer
Who is online
Users browsing this forum: No registered users and 96 guests