Jump to content
  • Advertisement
Sign in to follow this  
wild_pointer

Attaching effects to game objects

This topic is 3636 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

This is more of a responsibilty/organizational question. Say I have a ship and I'd like to have the engine light up and leave some kind of trail when it's accelerating. Should the ship own the effect totally? Do I create some kind of generic rigging system and attach the effect to the "engine" point? Who would then turn the effect on and off when needed? Does the effect listen to an event or does the ship know about the effect?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by wild_pointer
This is more of a responsibilty/organizational question. Say I have a ship and I'd like to have the engine light up and leave some kind of trail when it's accelerating.
In an ideal system, the effect would be driven entirely by events (i.e. Ship.Accelerate, Ship.CeaseAcceleration), though it could also be reasonably implemented by watching a variable (i.e. Ship.IsAccelerating).

As to your other question, in the same ideal system, the ship knows absolutely nothing about the graphical representation of itself or its engine - but this level of de-coupling is not always feasible in practice, especially if you are adapting an existing codebase.

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!