simple game development
  • home
    • Where to go
    • What to know
  • G.C.S.
    • GCS wiki
  • Games
  • Development
    • Software
    • Getting started
    • Programming >
      • ExampleCode
      • Coordinates
    • Game design
    • 3D vs 2D
  • Community
  • What's up?
    • Tutorials
  • About SG
    • Contact
    • Tell me
    • Extras >
      • Research
      • Desktop backgrounds

Effect manager!

11/1/2013

0 Comments

 
Udell Games  creates an awesome effect                                   manager.

Udell games says:
"
In Hyper Gauntlet, I have recently implemented a vignette system for the edges of the screen. Vignettes are coloured based on the changing game state, with a slow blue fade in and out during slow motion and a red flash when you hit an obstacle. Originally I tweened between colours as needed, but I soon met errors in common scenarios when the vignette colour must tween back to a previous effect colour. As an example, imagine an obstacle is approaching fast. I hold space to engage the slow motion, and a blue vignette appears around the screen. Unfortunately, I cannot move out of the way in time and I hit the obstacle – causing the vignette to fade quickly to red. In a basic system, the vignette would then fade back to a neutral state, instead of returning to the blue to signify that slow motion was still engaged, and this confuses players. Today I present a simple solution tailored for Unity systems that is applicable to any code base. It’s not just useful for vignetting either, I intend to also apply this system to slow motion (to apply power up-induced slow motion even when the player lets go of space for manual slow motion), and this could also find a use in stacking effect spells in RPGs.
"
But that's not all...
"
EffectLet’s start with the simplest class. It’s an effect. It doesn’t really do much at all, you’re meant to extend from it or any of its derived classes with your own, more specialised classes. Effect acts as a catchall for all effects so that they can all be processed. It does support events for tweening in though, as all effects can be gradually applied.


"
public class Effect
{
public float TweenInTime =0;

public event EventHandler OnTweenInBegin;  //invoked when the effect begins tweening in

public void BeginTweenIn()
{
EventHandler handler = OnTweenInBegin;
if(handler!= null)
{
handler(this,new TweenEventArgs(Value,TweenInTime));
}
}

public Effect()
{
}

public Effect(V value)
{
this.Value = value;
}

public V Value; //The final value (after tweening) to set the property we're affecting to.
}
That's all great but that's not half of it. There's more to know about how they created this "Effect Manager". You can read there actual post here: Effect Manager.
The post includes a lot more information and a lot more example code. So check it out! I did! :)
0 Comments

    Author

    Seth Vandebrooke: Simplegamings admin.

    Archives

    December 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013

    Categories

    All
    Community
    Development Environment
    Hub
    Projects
    Social Media

    RSS Feed


Powered by Create your own unique website with customizable templates.