Utilities + RumbleManager

RumbleManager Source

I have uploaded my rumble manager, which is a class, that I place underneath whatever object represents my player, to get additive rumbles in.  It needs to be created and know the player.  It also needs to be updated every frame with the GameTime.  It can be set by adding a value for the left motor, right motor, and then the time to rumble for.  Or it can be used with a few presets I made defined in the “RumbleType” enum.  Just call AddRumble on it.


Utility Classes Source

This file contains quite a few classes which I found myself repeating as sets of variables.  This includes the Quaternal Smoother from a previous post, as well as two other types of smoothers (Linear, and a rougher Rotational).  It also contains an egg-timer class “Timer” and my new personal favorite, the Compact Texture.   The Compact Texture takes a Texture2D and calculates the origin and scale for you.  This way, all the variables needed for a draw are kept in one place, under one name, and you only need to give your target dimensions, and don’t have to worry about awkward dividing.  All classes in this file are under the Utility namespace.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*