Z

Introduction All FlatRedBall shapes inherit from the PositionedObject class, so they inherit the X, Y, Z, and Position properties. The Z value of shapes impacts their rendering, but not collision. In other words, shapes will render differently according to their Z value when rendering on a 3D camera, but they will collide as if their[…]

CollideAgainst

Introduction Sprite collision methods are obsolete! The Sprite collision methods were written long before Entities and Glue. During that time the Sprite was intended to contain its own collision; however, now the Entity pattern has replaced this approach. The collision methods in the Sprite class have been left in but instead we recommend using the[…]

05.Creating the Screen Collision

Introduction So far we have a very simple project with a PlayerBall (which appears as a Circle) which can be moved with a Xbox 360 game pad or the keyboard. This tutorial will cover creating collision for the game. This tutorial introduces two new types. ShapeCollection – an object which can contain any number of[…]

DrawsShapes

Introduction The DrawsShapes property can be used to control whether the Camera will render any shapes (such as Polygons and Circles). This is on by default, and can be turned off to hide all shape rendering. Common Usage Shapes are often used for collision, and their visible representation can be useful in debugging. Shapes can[…]

Microsoft.Xna.Framework.Game.TargetElapsedTime

Introduction The TargetElapsedTime member allows you to control the update frame rate of your game. This value controls how often the Update method is called. It does not control how frequently your game is rendered to the screen.. In other words, if your game is rendering at 60 frames per second, but you modify this[…]

Thin Polygon Problem

Introduction The “thin Polygon problem”, also known as collision tunneling, is a collision bug that is very commonly collision problem. As the name suggests, this bug occurs when dealing with thin shapes. Although we use Polygons in this discussion, it applies to AxisAlignedRectangles as well. This bug manifests itself in one of three ways: Moving[…]

LastMoveCollisionReposition

Introduction The LastMoveCollisionReposition is a property that exists for all Shapes. If using CollisionRelationships, this property is set on any type of collision relationship that moves an object. This includes: Move Collision Bounce Collision Platformer Solid Collision Platformer Cloud Collision If using manual collision calls, this property is set whenever a shape calls CollideAgainstBounce or[…]

Tutorials:Introduction to Collision

Introduction The term “collision” in game development refers to both detecting whether objects are touching as well as changing the state of these objects when this touching occurs. Virtually any game ever made requires some type of collision. For example, Pong used ball vs. paddle collision and Super Mario Bros. performs collision between Mario and[…]

ProjectParentVelocityOnLastMoveCollisionTangent

Introduction The ProjectParentVelocityOnLastMoveCollisionTangent method can be used to create realistic collisions between a Circle and any other Shape. The Circle’s version of ProjectParentVelocityOnLastMoveCollisionTangent behaves the same as the Polygon‘s version. For more information, see the Polygon’s ProjectParentVelocityOnLastMoveCollisionTangent article.