Exemplo n.º 1
0
        public HeroShip(GraphicsContext gs)
        {
            graphics = gs;
            Texture2D t = new Texture2D("Application/Resources/Hero.png", false);
            Hero = new Sprite(gs, t);
            // Set position center.
            Hero.Position.X = graphics.Screen.Rectangle.Width / 2 - Hero.Width / 2;
            Hero.Position.Y = graphics.Screen.Rectangle.Height / 2 - Hero.Height /2;
            Speed = 3;

            //Hero.SetColor(1,0,0,2);
            Hero.Scale.X = 0.3f;
            Hero.Scale.Y = .3f;
        }
Exemplo n.º 2
0
        public Foreground(GraphicsContext gs)
        {
            graphics = gs;

            Texture2D t = new Texture2D("/Application/Resources/nebula_02.png", false);

            Nebula = new Sprite(graphics, t);
            Nebula.Position.X = 0;
            Nebula.Position.Y = 0;

            neebula = new Sprite(graphics, t);
            neebula.Position.X = Nebula.Width;
            neebula.Position.Y = 0;
        }
Exemplo n.º 3
0
        public AlienShip(GraphicsContext gs, int x, int y, int sp)
        {
            graphics = gs;

            Texture2D t = new Texture2D("Application/Resources/AlienShip.png", false);
            Alien = new Sprite(gs, t);
            // Set position center.
            Alien.Position.X = x;
            Alien.Position.Y = y;
            Speed = sp;

            //Hero.SetColor(1,0,0,2);
            Alien.Scale.X = 0.4f;
            Alien.Scale.Y = .4f;

            isLive = true;
        }
Exemplo n.º 4
0
        public explosion(GraphicsContext gs, int x, int y)
        {
            graphics = gs;

            Texture2D t = new Texture2D("Application/Resources/Flame.png", false);
            expl = new Sprite(gs, t);
            // Set position center.
            expl.Position.X = x;
            expl.Position.Y = y;
            Speed = 20.7f;

            /*// missile.SetColor(1,0,0,2);
            expl.Scale.X = 1.6f;
            expl.Scale.Y = .7f;*/

            isLive = true;
            // Frame initialization.
            activeFrame = 0;
            // Frame cell animation.
            expl.Height = FRAME_CELLSIZE;
            expl.Width = FRAME_CELLSIZE2;
        }
Exemplo n.º 5
0
        public Background(GraphicsContext gs)
        {
            graphics = gs;
            Texture2D t = new Texture2D("/Application/Resources/starsBackground.png", false);
            Starry = new Sprite(graphics, t);

            Starry.Position.X = 0;
            Starry.Position.Y = 0;
            // Second connected back ground.
            starries = new Sprite(graphics, t);

            starries.Position.X = Starry.Width;
            starries.Position.Y = 0;

            t = new Texture2D("/Application/Resources/nebula_01.png", true);

            nebula = new Sprite(graphics, t);
            nebula.Position.X = 0;
            nebula.Position.Y = 0;

            Nebula = new Sprite(graphics, t);
            Nebula.Position.X = nebula.Width;
            Nebula.Position.Y = 0;
        }