示例#1
0
 public Terrain(WormsGame parent)
     : base(parent)
 {
     this._position = new Vector2(0, 0);
     this._velocity = new Vector2(0, 0);  //Terrain does not need a velocity.
     this._speed = 0;     //Terrain does need a speed.
 }
示例#2
0
 public Player(WormsGame parent)
     : base(parent)
 {
     this._position = new Vector2(100, 100);
     this._velocity = new Vector2(0.0f, 0.0f);
     this._speed = 0;
 }
示例#3
0
 public PlayerRendering(WormsGame parent, GameObject container)
     : base(parent, container)
 {
     this.AddTexture("RedPlayerWithShotgun", "Default");
     this._activeTexture = _textures["Default"];
 }
            protected Dictionary<string, Texture2D> _textures; //Dictionary to organize textures by name. TODO: SpriteSheets & XML

            #endregion Fields

            #region Constructors

            //CONSTRUCTOR
            public RenderingComponent(WormsGame parent, GameObject container)
                : base(parent, container)
            {
                _textures = new Dictionary<string, Texture2D>();
                _sourceBatch = _parent._spriteBatch;
            }
示例#5
0
 //Variables
 //Constructor
 public InputComponent(WormsGame parent, GameObject container)
     : base(parent, container)
 {
 }
示例#6
0
 static void Main()
 {
     using (var game = new WormsGame())
         game.Run();
 }
示例#7
0
 public TerrainRendering(WormsGame parent, GameObject container)
     : base(parent, container)
 {
     this.AddTexture("TestTerrain", "Default");
     this._activeTexture = this._textures["Default"];
 }
示例#8
0
 public PlayerPhysics(WormsGame parent, GameObject container)
     : base(parent, container)
 {
 }
示例#9
0
            public WormsGame _parent; //Parent should always be the single "WormGame"

            #endregion Fields

            #region Constructors

            //CONSTRUCTOR
            public Component(WormsGame parent, GameObject container)
            {
                _parent = parent;
                _container = container;
            }
示例#10
0
 //Constructor
 public PlayerInput(WormsGame parent, GameObject container)
     : base(parent, container)
 {
 }
示例#11
0
 public PlayerTransform(WormsGame parent, GameObject container)
     : base(parent, container)
 {
 }
示例#12
0
 //Constructor
 public TransformComponent(WormsGame parent, GameObject container)
     : base(parent, container)
 {
 }
示例#13
0
            protected Vector2 _velocity; //The objects current velocity.

            #endregion Fields

            #region Constructors

            //CONSTRUCTOR
            public GameObject(WormsGame parent)
            {
                this._parent = parent;
                this._components = new Dictionary<string, Component>();
            }
示例#14
0
 //Constructor
 public PhysicsComponent(WormsGame parent, GameObject container)
     : base(parent, container)
 {
     this._collision = false;
 }