コード例 #1
0
        public void LoadWorld(ContentManager content, string Dir, int Nivel, int CantPuntos)
        {
            FrutiManiac    = false;
            PuntajeGeneral = CantPuntos;
            Board          = new Texture2D[] {
                content.Load <Texture2D>(Dir),
                content.Load <Texture2D>(Dir + "2"),
                content.Load <Texture2D>(Dir + "Power"),
            };
            Frame = 0;

            PosV = new Vector2(100, 50);
            P    = new Punticos(Pos, Board[0], PosV);
            P.Load(content, "Imagenes/Crump", "Imagenes/PowerPill", Nivel);

            Jugador = new Pacman(Pos, Velpacman);
            Jugador.Load(content);
            PosJ                = Jugador.GetPos();
            JugadorVivo         = true;
            JugadorVivoDameTime = true;

            TEX               = new Escrito(content, "Fuentes/SF1");
            Niv               = Nivel;
            TodoCatch         = false;
            TiempoCelebracion = 3.0f;

            Enemigo1 = new Fantasmas(Pos, 8, Color.Red);
            Enemigo2 = new Fantasmas(Pos, 8, Color.Green);
            Enemigo3 = new Fantasmas(Pos, 8, Color.Purple);
            Enemigo4 = new Fantasmas(Pos, 8, Color.Yellow);
            Enemigo1.Load(content, 0.5f + Nivel * 0.03f);
            Enemigo2.Load(content, 0.6f + Nivel * 0.03f);
            Enemigo3.Load(content, 0.7f + Nivel * 0.03f);
            Enemigo4.Load(content, 0.8f + Nivel * 0.03f);
        }
コード例 #2
0
 public void ReEspam(ContentManager content)
 {
     Jugador = new Pacman(Pos, Velpacman);
     Jugador.Load(content);
     PosJ                = Jugador.GetPos();
     JugadorVivo         = true;
     JugadorVivoDameTime = true;
 }
コード例 #3
0
ファイル: Mapa.cs プロジェクト: jmtt89/Pacmando
 public void ReEspam(ContentManager content)
 {
     Jugador = new Pacman(Pos, Velpacman);
     Jugador.Load(content);
     PosJ = Jugador.GetPos();
     JugadorVivo = true;
     JugadorVivoDameTime = true;
 }
コード例 #4
0
ファイル: Mapa.cs プロジェクト: jmtt89/Pacmando
        public void LoadWorld(ContentManager content, string Dir,int Nivel,int CantPuntos)
        {
            FrutiManiac = false;
            PuntajeGeneral = CantPuntos;
            Board = new Texture2D[] {
                content.Load< Texture2D >(Dir),
                content.Load<Texture2D>(Dir+"2"),
                content.Load<Texture2D>(Dir+"Power"),
            };
            Frame = 0;

            PosV = new Vector2(100, 50);
            P = new Punticos(Pos, Board[0],PosV);
            P.Load(content, "Imagenes/Crump", "Imagenes/PowerPill",Nivel);

            Jugador = new Pacman(Pos,Velpacman);
            Jugador.Load(content);
            PosJ = Jugador.GetPos();
            JugadorVivo = true;
            JugadorVivoDameTime = true;

            TEX = new Escrito(content, "Fuentes/SF1");
            Niv = Nivel;
            TodoCatch = false;
            TiempoCelebracion = 3.0f;

            Enemigo1 = new Fantasmas(Pos, 8, Color.Red);
            Enemigo2 = new Fantasmas(Pos, 8, Color.Green);
            Enemigo3 = new Fantasmas(Pos, 8, Color.Purple);
            Enemigo4 = new Fantasmas(Pos, 8, Color.Yellow);
            Enemigo1.Load(content, 0.5f + Nivel * 0.03f);
            Enemigo2.Load(content, 0.6f + Nivel * 0.03f);
            Enemigo3.Load(content, 0.7f + Nivel * 0.03f);
            Enemigo4.Load(content, 0.8f + Nivel * 0.03f);
        }
コード例 #5
0
        public void DetectarMov()
        {
            int Up;
            int Dw;
            int Rg;
            int Lf;

            PosJ = Jugador.GetPos();
            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                try
                {
                    Rg = Pos[(int)Math.Floor(PosJ.Y), (int)Math.Floor(PosJ.X) + 1];
                }
                catch (IndexOutOfRangeException)
                {
                    Rg = Pos[(int)Math.Floor(PosJ.Y), 27];
                }

                if (Rg == 1)
                {
                    Jugador.MoverD();
                    Pos[(int)Math.Floor(PosJ.Y), (int)Math.Floor(PosJ.X) + 1] = 4;
                    PuntajeGeneral += 10;
                }
                else if (Rg == 6)
                {
                    Jugador.TeleporI();
                }
                else if (Rg == 3)
                {
                    Jugador.MoverD();
                    Pos[(int)Math.Floor(PosJ.Y), (int)Math.Floor(PosJ.X) + 1] = 4;
                    Fantasmas.SetCagao();
                    PhantonKiller   = 0;
                    PuntajeGeneral += 30;
                    Frame           = 2;
                }
                else if (Rg == 4 || Rg == 5)
                {
                    Jugador.MoverD();
                }
                else
                {
                    Jugador.Detenerse();
                }

                P.ActualizarMatriz(Pos);
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                try
                {
                    Lf = Pos[(int)Math.Floor(PosJ.Y), (int)Math.Floor(PosJ.X) - 1];
                }
                catch (IndexOutOfRangeException)
                {
                    Lf = Pos[(int)Math.Floor(PosJ.Y), 0];
                }

                if (Lf == 1)
                {
                    Jugador.MoverI();
                    Pos[(int)Math.Floor(PosJ.Y), (int)Math.Floor(PosJ.X) - 1] = 4;
                    PuntajeGeneral += 10;
                }
                else if (Lf == 6)
                {
                    Jugador.TeleporD();
                }
                else if (Lf == 3)
                {
                    Jugador.MoverI();
                    Pos[(int)Math.Floor(PosJ.Y), (int)Math.Floor(PosJ.X) - 1] = 4;
                    Fantasmas.SetCagao();
                    PhantonKiller   = 0;
                    PuntajeGeneral += 30;
                    Frame           = 2;
                }
                else if (Lf == 4 || Lf == 5)
                {
                    Jugador.MoverI();
                }
                else
                {
                    Jugador.Detenerse();
                }

                P.ActualizarMatriz(Pos);
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Down))
            {
                try
                {
                    Dw = Pos[(int)Math.Floor(PosJ.Y) + 1, (int)Math.Floor(PosJ.X)];
                }
                catch (IndexOutOfRangeException)
                {
                    Dw = 0;
                }
                if (Dw == 1)
                {
                    Jugador.MoverAb();
                    Pos[(int)Math.Floor(PosJ.Y) + 1, (int)Math.Floor(PosJ.X)] = 4;
                    PuntajeGeneral += 10;
                }
                else if (Dw == 3)
                {
                    Jugador.MoverAb();
                    Pos[(int)Math.Floor(PosJ.Y) + 1, (int)Math.Floor(PosJ.X)] = 4;
                    Fantasmas.SetCagao();
                    PhantonKiller   = 0;
                    PuntajeGeneral += 30;
                    Frame           = 2;
                }
                else if (Dw == 4 || Dw == 5)
                {
                    Jugador.MoverAb();
                }
                else
                {
                    Jugador.Detenerse();
                }

                P.ActualizarMatriz(Pos);
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Up))
            {
                try
                {
                    Up = Pos[(int)Math.Floor(PosJ.Y) - 1, (int)Math.Floor(PosJ.X)];
                }
                catch (IndexOutOfRangeException)
                {
                    Up = 0;
                }
                if (Up == 1)
                {
                    Jugador.MoverAr();
                    Pos[(int)Math.Floor(PosJ.Y) - 1, (int)Math.Floor(PosJ.X)] = 4;
                    PuntajeGeneral += 10;
                }
                else if (Up == 3)
                {
                    Jugador.MoverAr();
                    Pos[(int)Math.Floor(PosJ.Y) - 1, (int)Math.Floor(PosJ.X)] = 4;
                    Fantasmas.SetCagao();
                    PhantonKiller   = 0;
                    PuntajeGeneral += 30;
                    Frame           = 2;
                }
                else if (Up == 4 || Up == 5)
                {
                    Jugador.MoverAr();
                }
                else
                {
                    Jugador.Detenerse();
                }

                P.ActualizarMatriz(Pos);
            }
        }