AiTest2/PlayerSprite.cs
Download
aitest2.zip
(14.13 KB | 07 July 2010 )
Sample project for implementing collision detection in the sprites of the Boulder Dash (Boulderdash) arcade game.
Donate
If this site or its services have saved you time, please consider a donation to help with running costs and timely updates.
Contents of aitest2.zip/AiTest2/PlayerSprite.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace AiTest
{
class PlayerSprite : Sprite
{
#region Public Overridden Methods
public override CollisionAction GetCollisionAction(Sprite collidedWith)
{
return CollisionAction.Explode; // Player dies if it touches any other sprites
}
public override void Move()
{
// Do nothing, this sprite doesn't automatically move
}
#endregion Public Overridden Methods
#region Public Properties
public override Color Color
{
get { return Color.Aquamarine; }
}
#endregion Public Properties
}
}
