Sign in to follow this  
wild_pointer

Attaching effects to game objects

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this