Exemplo n.º 1
0
        //soundtouch
        //
        //  public void DrawCubo(float x1,float y1,float z1,float x2,float y2,float z2);
        public SharpGLForm()
        {
            KeyA=false;
             KeyS = false; KeyD = false;
             KeyW=false; KeySpace=false;
            WektorZero = new Wektor(0, 0, 0);
            PlayerWektorSpeed = new Wektor(0, 0, 0);
            PlayerLive = 7;
            YAxisCamera = 5;
            CursorWektor = new Wektor(0, 0, 0);
            CursorWektorAngled = new Wektor(0, 0, 0);
            Boss = new KwadratBoss(true);
               // new List<int>();
            listaPociskow = new List<KwadratMaterialnyPocisk>();
            listaPociskowPlayera = new List<KwadratMaterialnyPocisk>();
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie, new Wektor(0.1f, 0.0f, -0.13f), 22));
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie, new Wektor(0.09f, 0.0f, -0.03f), 22));
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie, new Wektor(-0.14f, 0.0f, -0.133f), 22));
            for(int i=0 ; i<13 ; i++)
            {
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie,losowyWektorPredkosci(),20));
            }

            cuboPlayer = new kwardratMaterialny(new Wektor(0.0f,0.0f,0.0f),new Wektor(0.0f,0.0f,0.0f),new Wektor(0.4f,0.4f,0.4f),new Wektor(0.2f,0.2f,0.2f),45);
             //       Wektor temp,temp1;
             //       temp = new Wektor(0.0f,0.0f,0.0f);
               //     temp1 = new Wektor(0.2f,0.0f,-0.1f);
            bulletOne = new KwadratMaterialnyPocisk(new Wektor(0.0f, 0.0f, 0.0f),new Wektor(0.2f, 0.0f, 0.03f), 40);
            bulletOne = new KwadratMaterialnyPocisk(new Wektor(0.0f, 0.0f, 0.0f), 30);
            //bulletOne = new KwadratMaterialnyPocisk(temp, temp1, 30);
               // new KwadratMaterialnyPocisk()

            da = new Wektor(1.0f, 1.0f, 1.0f);
            //    Wektor re;
            re = new Wektor(2.0f, 1.0f, 1.0f);

            InitializeComponent();
            this.Controls.Add(openGLControl);

            // this.
            // openGLControl.KeyPress += openGLControl_KeyPress;
            this.openGLControl.KeyPress += new KeyPressEventHandler(keypressed);
            this.openGLControl.KeyDown += new KeyEventHandler(Form2_KeyDown);
            this.openGLControl.KeyUp += new KeyEventHandler(Form1_KeyUp);
            this.openGLControl.MouseClick += Control1_MouseClick;
        }
Exemplo n.º 2
0
        //soundtouch
        //
        //  public void DrawCubo(float x1,float y1,float z1,float x2,float y2,float z2);
        public SharpGLForm()
        {
            Basic_Size = 17;
            MazeCellsIntTab= new int[Basic_Size][];
            for (int j = 0; j < Basic_Size;j++ )
            {
                MazeCellsIntTab[j] = new int[Basic_Size];
            }

                ListaKolizji = new List<Wektor>();
            ListaKolizjiX = new List<float>();
            ListaKolizjiZ = new List<float>();
            MazeCellType = new List<int>();
            rysowM =new RysownikMaze();
            StraightTrap = new TrapChecker();
              //  Sprawdzacz = new SprawdzaczKolizji();
            MyMaze = rysowM.DrawMazeSkelethOfSize(25,true);
            MyMazeTwo = rysowM.DrawMazeSkelethOfSize(Basic_Size,false);
            first_time = false;
            tempMazeList = rysowM.ConvertMazeStructToListOfTypes(MyMazeTwo);

               for(int i=0;i<Basic_Size*Basic_Size;i++)
               {
                   MazeCellsIntTab[i / Basic_Size][i % Basic_Size] = tempMazeList.ElementAt(i);
               }

                KeyA = false;
             KeyS = false; KeyD = false;
             KeyW=false; KeySpace=false;
            WektorZero = new Wektor(0, 0, 0);
            PlayerWektorSpeed = new Wektor(0, 0, 0);
            PlayerLive = 7;
            YAxisCamera = 5;
            CursorWektor = new Wektor(0, 0, 0);
            CursorWektorAngled = new Wektor(0, 0, 0);
            Debug.WriteLine("j");
            Boss = new KwadratBoss(true);
               // new List<int>();
            listaPociskow = new List<KwadratMaterialnyPocisk>();
            listaPociskowPlayera = new List<KwadratMaterialnyPocisk>();
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie, new Wektor(0.1f, 0.0f, -0.13f), 22));
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie, new Wektor(0.09f, 0.0f, -0.03f), 22));
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie, new Wektor(-0.14f, 0.0f, -0.133f), 22));
            for(int i=0 ; i<13 ; i++)
            {
            listaPociskow.Add(new KwadratMaterialnyPocisk(Boss.polozenie,losowyWektorPredkosci(),20));
            }

            cuboPlayer = new kwardratMaterialny(new Wektor(0.0f,0.0f,0.0f),new Wektor(0.0f,0.0f,0.0f),new Wektor(0.4f,0.4f,0.4f),new Wektor(0.2f,0.2f,0.2f),45);
             //       Wektor temp,temp1;
             //       temp = new Wektor(0.0f,0.0f,0.0f);
               //     temp1 = new Wektor(0.2f,0.0f,-0.1f);
            bulletOne = new KwadratMaterialnyPocisk(new Wektor(0.0f, 0.0f, 0.0f),new Wektor(0.2f, 0.0f, 0.03f), 40);
            bulletOne = new KwadratMaterialnyPocisk(new Wektor(0.0f, 0.0f, 0.0f), 30);
            //bulletOne = new KwadratMaterialnyPocisk(temp, temp1, 30);
               // new KwadratMaterialnyPocisk()

            da = new Wektor(1.0f, 1.0f, 1.0f);
            //    Wektor re;
            re = new Wektor(2.0f, 1.0f, 1.0f);

            InitializeComponent();
            this.Controls.Add(openGLControl);

            // this.
            // openGLControl.KeyPress += openGLControl_KeyPress;
            this.openGLControl.KeyPress += new KeyPressEventHandler(keypressed);
            this.openGLControl.KeyDown += new KeyEventHandler(Form2_KeyDown);
            this.openGLControl.KeyUp += new KeyEventHandler(Form1_KeyUp);
            this.openGLControl.MouseClick += Control1_MouseClick;
        }