|
using System;
using System.Drawing;
namespace Pocket1945
{
/// <summary>
/// This interface is implemented by all game classes
/// that can be drawn to the screen. The interface has only
/// one method passing in a graphics object which the class should
/// use to draw itself.
/// </summary>
public interface IDrawable
{
/// <summary>
/// Method drawing the game object to the screen.
/// </summary>
/// <param name="g">The graphics object used to draw the sprite.</param>
void Draw(Graphics g);
}
/// <summary>
/// This interface is implementet by all game classes that
/// are armed. The interface contains methods to check if the item
/// can fire a bullet, a method to fire a new bullet, and a method to
/// act on a bullet hit.
/// </summary>
public interface IArmed
{
/// <summary>
/// Method checking if the game object can fire.
/// </summary>
/// <returns>True if the object can fire a new bullet.</returns>
bool CanFire();
/// <summary>
/// Method executing a new bullet hit.
/// </summary>
/// <param name="b">The bullet hitting the game object.</param>
void Hit(Bullet b);
/// <summary>
/// Method fiering a new bullet.
/// </summary>
/// <returns>Returns a new bullet.</returns>
Bullet Fire();
}
/// <summary>
/// This interface is implemented by all game objects that you can collide
/// into. Examples of collidable objects are the player, the enemies and bonuses.
/// The method contains one method returning a rectangle defining the collition area.
/// </summary>
public interface ICollidable
{
/// <summary>
/// Method returning the collition area of the game object.
/// </summary>
/// <returns>A rectangle definging the collition area of the game object.</returns>
Rectangle GetCollitionRectangle();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm a C# developer from Norway. I'm a co-founder of a small ISV called GreIT AS. Our company site can be found at http://www.greit.no (all information in norwegian).
My everyday work consists of building ASP.NET web applications and work on our content management system, Webpakken. I use my spare time on side projects such as Pocket 1945 (http://workspaces.gotdotnet.com/pocket1945), a shooter game for the Pocket PC platform. It’s almost the opposite of my everyday work since games are small, focus on graphics and entertainment, while our CMS is large, focus on businesses and data.
When I’m not sitting in front of the computer I go snowboarding or skateboarding, depending on which time of the year it is.
I also enjoy fly fishing for salmon and trout in the summer. My personal record is a 10.5 KG salmon caught in Lakselva last summer and a 2 KG trout caught some where secret place in Finnmark. A bragging picture of me holding the salmon can be found at http://jonas.greit.no/pictures/salmon.jpg .
I did start blogging some time back, but I haven’t been to good at updating my blogg. I just got so much stuff going on that it’s hard to find time to add blogg posts. You can view my blogg at http://jonas.greit.no, just don’t expect too much.