Ejemplo n.º 1
0
 public Stage(Stage s)
 {
     this.studentSpeed = s.studentSpeed;
     this.checkpoints = s.checkpoints;
     this.startPosition = s.startPosition;
     this.numCP = s.numCP;
     this.classes =s.classes;
     this.startingCash = s.startingCash;
     this.studentsPerClas = s.studentsPerClas;
     this.studentHealth = s.studentHealth;
 }
Ejemplo n.º 2
0
        public void drowStage(Stage s,Graphics g)
        {
            int x, y, pathWidth, lastDir;
            pathWidth = 60;
            int width = 0, height = 0;
            Color color = System.Drawing.ColorTranslator.FromHtml("#339900");
            g.FillRectangle(new SolidBrush(color), new Rectangle(s.startPosition.x, s.startPosition.y, s.checkpoints[0].value + pathWidth, pathWidth));
            y = s.startPosition.y;
            x = s.checkpoints[0].value;
            lastDir = 2;
            for (int i = 0; i < s.numCP - 1; i++)
            {
                if (lastDir == 2)
                {
                    if (s.checkpoints[i].coordinate == 3)
                    {
                        if (i != 0)
                        {
                            y = s.checkpoints[i - 1].value;
                            x = s.checkpoints[i].value;
                        }
                        width = pathWidth;
                        height = s.checkpoints[i + 1].value - y + pathWidth;
                    }
                    else if (s.checkpoints[i].coordinate == 1)
                    {
                        x = s.checkpoints[i].value;
                        y = s.checkpoints[i + 1].value;
                        width = pathWidth;
                        height = s.checkpoints[i - 1].value-y + pathWidth;
                    }
                }
                else if (lastDir == 3)
                {
                    if (s.checkpoints[i].coordinate == 4)
                    {
                        x = s.checkpoints[i + 1].value;
                        y = s.checkpoints[i].value;
                        width = s.checkpoints[i - 1].value - x;
                        height = pathWidth;
                    }
                    else if (s.checkpoints[i].coordinate == 2)
                    {
                        x = s.checkpoints[i - 1].value;
                        y = s.checkpoints[i].value;
                        width = s.checkpoints[i + 1].value - x;
                        height = pathWidth;
                    }

                }
                else if (lastDir == 4)
                {
                    if (s.checkpoints[i].coordinate == 3)
                    {
                        x = s.checkpoints[i].value;
                        y = s.checkpoints[i - 1].value;
                        width = pathWidth;
                        height = s.checkpoints[i + 1].value - y + pathWidth;
                    }
                    else if (s.checkpoints[i].coordinate == 1)
                    {
                        x = s.checkpoints[i].value;
                        y = s.checkpoints[i + 1].value;
                        width = pathWidth;
                        height = y - s.checkpoints[i + 1].value + pathWidth;
                    }

                }
                else if (lastDir == 1)
                {
                    if (s.checkpoints[i].coordinate == 4)
                    {
                        x = s.checkpoints[i + 1].value;
                        y = s.checkpoints[i].value;
                        width = s.checkpoints[i - 1].value - x;
                        height = pathWidth;
                    }
                    else if (s.checkpoints[i].coordinate == 2)
                    {
                        x = s.checkpoints[i-1].value;
                        y = s.checkpoints[i].value;
                        width = s.checkpoints[i + 1].value - x;
                        height = pathWidth;
                    }

                }

                lastDir = s.checkpoints[i].coordinate;
                g.FillRectangle(new SolidBrush(color), new Rectangle(x, y, width, height));
            }
            x = s.checkpoints[s.numCP-1].value;
               // y = s.checkpoints[i + 1].value;
            color = System.Drawing.ColorTranslator.FromHtml("#993399");
            g.FillRectangle(new SolidBrush(color), new Rectangle(x, y-20, 100, 100));
        }
Ejemplo n.º 3
0
        public void init()
        {
            profesors = new List<Profesor>();
            students = new List<Student>();
            bullets = new List<Bullet>();
            pbox = formPlay.pbox;
            stages = new Stage[Data.stages.Count()];
            for(int i=0;i<Data.stages.Count();i++){
                stages[i] = new Stage(Data.stages[i]);
            }
            cash = stages[level].startingCash;
            lives = 5;
            vave=1;
            timer = 0;
            sClass = 0;
            generatedStudents = 0;
            nextStudentSpown = 60;

            formPlay.cash.Text = cash + "";
            formPlay.level.Text = level + 1 + "";
            formPlay.lives.Text = lives + "";
            formPlay.tbVave.Text = "1/" + stages[level].classes;
        }