Ejemplo n.º 1
0
 public Earth(MyGame _main) : base(_main)
 {
     main     = _main;
     texture  = sprite.earth;
     position = new Vector2(32, 32);
     main.utility.CallAfter(0.6f, EnableMoveEarth);
 }
Ejemplo n.º 2
0
 public Utility(MyGame _main)
 {
     main       = _main;
     background = Color.DarkCyan;
     paused     = false;
     newColour  = currentColour = Color.White;
 }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     using (MyGame game = new MyGame())
     {
         game.Run();
     }
 }
Ejemplo n.º 4
0
 public Entity(MyGame _main) : base(_main)
 {
     main   = _main;
     sprite = main.Services.GetService(typeof(TextureAsset)) as TextureAsset;
     main.Components.Add(this);
     spriteBatch = main.Services.GetService(typeof(SpriteBatch)) as SpriteBatch;
 }
Ejemplo n.º 5
0
 public Rocket(MyGame _main) : base(_main)
 {
     main      = _main;
     collision = main.Services.GetService(typeof(Collision)) as Collision;
     collision.list.Add(this);
     fire     = new Animation();
     position = new Vector2(main.utility.RandomRange(64, 736), -50);
     ySpeed   = 1.5f;
     tag      = "enemy";
     fire.Initialize(sprite.fire, position + new  Vector2(0, -50), 64, 64, 4, 100, Color.White, 1.2f, true);
     this.texture = sprite.rocket;
 }
Ejemplo n.º 6
0
        public Formation(MyGame _main)
        {
            main               = _main;
            difficulty         = 0;// 0,1,2 - easy, normal, hard
            maxFormationLength = 0;

            main.utility.CallAfter(3.0f, () => {
                InitEnemies();
                main.utility.RepeatEvery(9.1666f, InitEnemies);
            });

            main.utility.RepeatEvery(30, InitRocket);
        }
Ejemplo n.º 7
0
        public Player(MyGame _main) : base(_main)
        {
            main      = _main;
            GameInput = main.Services.GetService(typeof(GameInput)) as GameInput;
            collision = main.Services.GetService(typeof(Collision)) as Collision;
            collision.list.Add(this);
            //change this into vector 2 later
            screenLimitX = (int)main.GraphicsDevice.Viewport.TitleSafeArea.Width;
            screenLimitY = (int)main.GraphicsDevice.Viewport.TitleSafeArea.Height;
            tag          = "player";
            lives        = 3;
            health       = 1;
            ammoText     = "full";
            ammoNumber   = 0;
            this.texture = sprite.player;
            originalPos  = new Vector2(main.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, main.GraphicsDevice.Viewport.TitleSafeArea.Height - 64);
            Vector2 playerPosition = originalPos;

            position      = playerPosition;
            currentWeapon = sprite.icon_bullet;
        }
Ejemplo n.º 8
0
 public Image(Texture2D _texture, Vector2 _pos, MyGame _main) : base(_main)
 {
     main     = _main;
     texture  = _texture;
     position = _pos;
 }
Ejemplo n.º 9
0
 public SpaceShooter(MyGame main) : base(main)
 {
     Initialize();
 }
Ejemplo n.º 10
0
 public ScoreMenu(MyGame main) : base(main)
 {
     Initialize();
 }
Ejemplo n.º 11
0
 public Explosion(MyGame _main) : base(_main)
 {
     main = _main;
 }
Ejemplo n.º 12
0
 public Enemy(MyGame _main) : base(_main)
 {
     main = _main;
     Initialize();
 }
Ejemplo n.º 13
0
 public Background(MyGame _main) : base(_main)
 {
     main = _main;
 }
Ejemplo n.º 14
0
        static void Main(string[] args)
        {
            MyGame game = new MyGame();

            game.InitInstance();
        }
Ejemplo n.º 15
0
 public PowerUp(MyGame _main) : base(_main)
 {
     main      = _main;
     collision = main.Services.GetService(typeof(Collision)) as Collision;
     collision.list.Add(this);
 }
Ejemplo n.º 16
0
 public Scene(MyGame _main) : base(_main)
 {
     main = _main;
 }
Ejemplo n.º 17
0
 public Bullet(MyGame _main) : base(_main)
 {
     main = _main;
 }