Click here to Skip to main content
15,896,118 members
Articles / Programming Languages / C# 2.0

Sample Pamper Series - Part 4: 2/3D Space Game, Simple Sounds, and Threads

Rate me:
Please Sign up or sign in to vote.
4.67/5 (11 votes)
4 Apr 2012CPOL5 min read 39.7K   714   42  
This article is the final one in the series, and it will give you a 2/3D space game out of what we have learnt from previous articles. We will also apply simple sounds to it played in threads.
using System;
using Engine3DVP;


namespace Engine3D
{
	/// <summary>
	/// Summary description for Enemy.
	/// </summary>
	internal class Enemy: Object3D, IEnemy
	{
		private bool mInWar;
		private bool mIsDead;

		public Enemy(int energy){this.mInWar = false;this.mIsDead = false;this.Energy = energy;}

		//Creating and placing, giving a rotation value.
		public Enemy(Poinx3D place, double rotX, double rotY, double paseX, double paseY, int energy)
		{
			this.mInWar = false;
			this.mIsDead = false;
			this.ObjPos = place;
			this.SetRotX(rotX);
			this.SetRotY(rotY);
			this.PaseX = paseX;
			this.PaseY = paseY;
			this.Energy = energy;
		}
		//Enemy in war?
		public bool InWar
		{
			set
			{
				this.mInWar = value;
			}
			get
			{
				return this.mInWar;
			}
		}
		//Enemy dead??
		public bool IsDead
		{
			set
			{
				this.mIsDead = value;
			}
			get
			{
				return this.mIsDead;
			}
		}
	}
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Sweden Sweden
Professional programmer, degree in Informatics and Applied Systems Science.

Comments and Discussions