Platform Entity


NOTE: This entity is no longer maintained and has been replaced by a plugin:

Please switch to using the plugin instead.


Entity base class which can be integrated with very few lines of code. This can be used for most types of platforms. It includes double jumps, acceleration and immediate velocity movement, water swimming, variable jump heights through button pushed, and no-snag tile collision support.

Behavior can be modified without writing any code - it's all in a contained CSV file.

Integration instructions have been moved to the FlatRedBall wiki. Check them out here:

Updated July 15, 2015

* Fixed typo in custom code.

Updated May 29, 2015

* Fixed a number of bugs related to gravity not being set.

Update April 18, 2015

* Refactored some code to make the method names clearer
* Commented the entire codebase
* Removed the need to manually apply movement values.
* Made CustomInitialize call a virtual function for assigning input - allowing derived classes to override this.

Update April 9, 2015

* Added JumpAction and LandedAction so custom code can react to jumping and landing.

Update January 17, 2015

* Renamed the "Collision" object to "RectangleInstance" so the character can be made implement ICollidable.

Updated December 17, 2014

* Updated platformer to use AnalogStick.Horizontal instead of GetHorizontal()

Updated December 10, 2014

* Changed input code to use the new IPressableInput and I1DInput for more customizability

Updated October 4, 2014

* Added support for animation - still needs hookup.

Updated September 13, 2014:
* Added animations which an be set in Glue. When set and when SetAnimations is called then the Entity will automatically have its animations set.

Updated May 11, 2014:
* Collision functions can be called multiple times without the character thinking it's in the air.

Updated February 16, 2014:
* Added property for InputEnabled which can be turned off to prevent the player from responding to input.

Update September 1, 2013:
* Added a CollideAgainst method which takes a Func enabling custom collision. This has been added so that this object can be used with the Tile Graphics Plugin that was released on September 1, 2013.

Update August 31, 2013:
* Fixed bug where changing the movement values after initialization would not actually change any behaviors on the entity.

Updated July 2, 2013:
* Collision object by default sets HasPublicProperty to true since it needs to be set to true for collision.
* All platformer variables have SetByDerived set to true so inheriting objects can change the values.
* Added overload to method so collision can be either solid or cloud.

Updated July 1, 2013:
* Implemented max fall speed - this wasn't present before
* Changed the Collision object to use the new "Width" and "Height" properties instead of "ScaleX" and "ScaleY"
* Collision object now has "ExposedInDerived" set to true so that entities which inherit from this can modify the collision.
* IsOnGround is now a public property so derived classes and containing Screens can see if a given Entity is standing on the ground.

Updated January 18, 2013:
* Modified the code to handle the Screen and ScreenManager changes made in FRB

Syndicate content