🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Help clarify if I'm organizing these objects properly

Started by
-1 comments, last by coremarq 8 years, 3 months ago

OK, I've only been using Unity for about a week now and loving it so far. Though I've never used an engine or a full on Entity/Component system before either, so I don't know if I'm confused or just over complicating things. Hell I'll probably figure it out just from typing this out ;-)

QUESTION 1:

Basic Scenario ;

I have 3 objects, The Game (logic and global game specific data), Hero and a Monster. The hero should attack the monster every time it can, and the game keeps track of how many monsters are killed. What I'm confused about is the way all these objects will interact with each other.

Normally I would have a structure kinda like so ;

vector<Hero>;

vector<Monster>;

class CombatController;

The CombatController would update all the heroes timers and handle triggering the heroes to attack and applying that heroes damage to the monsters and so forth. Is that logical in Unity? Should I just make an empty object that is simply just a script to handle that logic?

QUESTION 2:

Probably a dumb question, if I want to add a variable to an object such as hero having a damage value. Right now I just add a script to the object and add a member to the class. Is that correct?

This topic is closed to new replies.

Advertisement