Jump to content
  • Advertisement
Sign in to follow this  
swinchen

My first design, UML suggestions

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, So far I seem to be doing alright with simple demos, but now I am trying my first design and am having a tough time. Here is my first attempt at a UML diagram: Now I know it isn't complete, but does this look like I am on the right track? Each sprite can have multiple animations (that is why the multiplicity is 1..*) What I am really concerned about is that a sprite and it's animation should both have the same x and y coordinates, yet seeing they are both generalizations of CObject they have independent x and y. Any suggestions, or links that describe UML and software design like this would be great appreciated. Thanks, Sam

Share this post


Link to post
Share on other sites
Advertisement
Why are animations objects? That's just silly.

Ask your self (or more specificly your objects) what do they represent?
To me an animation is a collection of frames that can be played to show pretty pictures. But it really doesn't need to know where in the world it does this marvelous feat.

Wouldn't it feel better if whoever needs to display an animation knew where it should be? I belive so (actually even keeping track of the current frame probably is better left to an external object).

I would say that you want:

Animation ---- 1..* <> Sprite
#frames etc as before
^
v Objectt
1 ^
| |
| |
AnimationControl <> 1 -------------- AnimatedObject
#active frame, time etc


hope that ASCII drawing helps.

Share this post


Link to post
Share on other sites
Alright, I am not sure I follow.

So each Sprite contains 1 or more animation (I understand that)

Each animation contains 1 animation control. Ok, or should it be the other way around?
Animation ---- 1<> AnimationControl, or
Animation <>1 ---- AnimationControl?

And then each Animation control has 1 AnimatedObject? This one seems backwards to me or maybe I dont understand the direction of ---<>

Maybe I will draft up another one with these suggestions.

Share this post


Link to post
Share on other sites
Uh, I thought I followed your convention anhow this is what I ment:

Animations have 1..n Sprites
AnimationControls know about exactly 1 animation
AnimatedObject is an Object that knows about 1 animation control.

Hope that clears it up.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!