Esempio n. 1
0
        public void DrawObject(ObjectOnDisplay obj, OpenGL gl)
        {
            ShipTexturesHelper.GetShipTexture(gl, ((MapEnemy)obj.GameObject).Data.ShipName).Bind(gl);
            var size = new Size(80, 80);

            DrawHelper.Draw(obj, gl, size, ((MapEnemy)obj.GameObject).Angle);
        }
Esempio n. 2
0
        public void DrawObject(ObjectOnDisplay obj, OpenGL gl)
        {
            blast.Bind(gl);
            var size = new Size(10, 50);

            DrawHelper.Draw(obj, gl, size, ((Blast)obj.GameObject).Angle);
        }
Esempio n. 3
0
        public void DrawObject(ObjectOnDisplay obj, OpenGL gl)
        {
            background.Bind(gl);
            var size = new Size(1000, 1000);

            DrawHelper.Draw(obj, gl, size);
        }
Esempio n. 4
0
        public static void Draw(ObjectOnDisplay obj, OpenGL gl, Size size)
        {
            var arrayVectors = GetObjectCorners(obj.PositionOnDisplay, size);
            var priority     = obj.GameObject.DrawingPriority;

            gl.Begin(BeginMode.Quads);
            for (var i = 0; i < 4; i++)
            {
                gl.TexCoord(ArrayTexCoords[i].X, ArrayTexCoords[i].Y);
                gl.Vertex(arrayVectors[i].X, arrayVectors[i].Y, priority);
            }

            gl.End();
        }
Esempio n. 5
0
        public void DrawObject(ObjectOnDisplay obj, OpenGL gl)
        {
            exp.Bind(gl);
            var o      = (Explosion)obj.GameObject;
            var size   = new Size(1080, 1080);
            var pos    = GetObjectCorners(obj.PositionOnDisplay, size);
            var posTex = ArrayTexCoords(data[o.frame].Item1, data[o.frame].Item2);

            gl.Begin(BeginMode.Quads);
            for (var i = 0; i < 4; i++)
            {
                gl.TexCoord(posTex[i].X, posTex[i].Y);
                gl.Vertex(pos[i].X, pos[i].Y, 0);
            }

            gl.End();
        }
Esempio n. 6
0
        public static void Draw(ObjectOnDisplay obj, OpenGL gl, Size size, double angle)
        {
            var arrayVectors   = GetObjectCorners(obj.PositionOnDisplay, size);
            var rotatedVectors = new Vector2D[4];

            for (var i = 0; i < 4; i++)
            {
                rotatedVectors[i] = (arrayVectors[i] - obj.PositionOnDisplay).Rotate(-angle) + obj.PositionOnDisplay;
            }
            var priority = obj.GameObject.DrawingPriority;

            gl.Begin(BeginMode.Quads);
            for (var i = 0; i < 4; i++)
            {
                gl.TexCoord(ArrayTexCoords[i].X, ArrayTexCoords[i].Y);
                gl.Vertex(rotatedVectors[i].X, rotatedVectors[i].Y, priority);
            }

            gl.End();
        }
Esempio n. 7
0
 public void DrawObject(ObjectOnDisplay obj, OpenGL gl)
 {
     ShipTexturesHelper.GetShipTexture(gl, ((Player)obj.GameObject).Data.ShipName).Bind(gl);
     DrawHelper.Draw(obj, gl, obj.GameObject.Size, ((Player)obj.GameObject).Angle);
 }
Esempio n. 8
0
 public void DrawObject(ObjectOnDisplay obj, OpenGL gl)
 {
     ShipTexturesHelper.GetShipTexture(gl, ((BattleEnemy)obj.GameObject).Data.ShipName).Bind(gl);
     DrawHelper.Draw(obj, gl, new Size(100, 110), ((BattleEnemy)obj.GameObject).Angle);
 }