Circle Collision

Introduction Although FlatRedBall XNA provides a Circle class for collisions, you may be interested in writing your own custom circle collision code for customizable behavior. If so, read on. Detecting Collision The most basic form of collision returns true or false to indicate if two circles are touching. To keep things lightweight, consider a class[…]

Async and Await

Introduction FlatRedBall provides a built-in synchronization context enabling the use of async and await keywords while keeping logic on the primary thread. This document discusses common usage of these keywords. Async and Await Concepts For a general discussion of async and await, see the Microsoft Asynchronous Programming page. The most common  FlatRedBall usage of asynchronous[…]

IncludeInICollidable

Introduction The IncludeInICollidable property controls whether an object is included in the container Entity’s Collision ShapeCollection. By default this value is set to true, which means that any shape included in an ICollidable entity will be considered in collision. This can be set to false to exclude a Shape from the Collision ShapeCollection. Example – Excluding[…]

Entity Performance

Introduction The Entity Performance tab provides options for improving the runtime performance (reducing CPU usage) for an entity. This tab is only needed for games which include a very large number of entities (typically many hundreds or thousands of instances). Common types of entities which benefit from this tab are enemies and bullets. Entity Performance[…]

03 – Shooting Bullets

Introduction This tutorial adds a Bullet entity which the player can shoot. The Bullet entity has the following characteristics: It will be visually represented by a circle It moves left or right depending on which way the Player is facing when shooting It will be destroyed when colliding with the SolidCollision It will be destroyed[…]

01. Setup

Introduction This tutorial sets up an entity with Top Down controls. It provides a default implementation which requires no code. Later tutorials show how to interact with this plugin using code. Requirements The top down controls must be added to an entity, so for this tutorial we will create an entity and add it to[…]

01 – Creating a Top Down Entity

Introduction This tutorial shows how to create an entity which can be used as a top down entity. It requires understanding the basics of working with Glue including: Creating a Screen Creating an ntity Adding an Entity instance to a Screen Running a Glue project Creating an Entity For this project we’ll begin with a[…]

CollideAgainst

Introduction The CollideAgainst function returns a bool value indicating whether the calling TileShapeCollection collides with the argument. CollideAgainst can be used to test collisions against: ICollidable (usually Glue entities) AxisAlignedRectangle Circle Line Polygon Note that in most cases CollideAgainst does not need to be called because collision relationships can be created between TileShapeCollections and Glue[…]

CollisionRelationship

Introduction Glue supports the creation and management of CollisionRelationship objects. This document covers the features provided by Glue, and explains common scenarios where you may need to interact with the CollisionsRelationships in code. Most cases can be handled by CollisionRelationships in Glue; however, more advanced situations can be handled in code. For information about creating[…]

RotationZ

Introduction RotationZ is the rotation value of the positioned object along the Z axis. For most games this value is used to rotate an object such as a car in a top-down game, or a spinning particle. RotationZ is represented in radians. Although RotationZ is a property on all PositionedObjects, the Circle and AxisAlignedRectangle objects[…]