예제 #1
0
파일: Entity.cs 프로젝트: Frib/LD25
 internal static Entity Parse(World w, string p)
 {
     switch (p.First())
     {
         case 'H': return Human.Create(w, p.Substring(2));
         case 'D': return Door.Create(p.Substring(2));
         case 'W': return Workplace.Create(p.Substring(2));
         case 'R': return Robot.Create(w, p.Substring(2));
         case 'C': return Crate.Create(p.Substring(2));
         case 'E': return ExplosiveCrate.Createueue(p.Substring(2));
         case 'S': return SentryGun.Create(p.Substring(2));
         case 'A': return Camera.Create(p.Substring(2));
         case 'I': return Incinerator.Create(p.Substring(2));
         default: throw new Exception();
     }
 }
예제 #2
0
파일: Entity.cs 프로젝트: Frib/LD25
 internal static void LinkToNode(World w, string p)
 {
     var split = p.Split(':');
     w.entities[int.Parse(split[0])].Pathnode = w.Pathnodes[int.Parse(split[1])];
 }
예제 #3
0
파일: GameScreen.cs 프로젝트: Frib/LD25
        public override void Update()
        {
            if (RM.IsPressed(InputAction.RestartLevel))
            {
                world = new World(RM.Levels[currentLevel]);
            }

            if (!Victorious && !world.editorEnabled && ((world.allowEditor && IM.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.N)) || world.entities.OfType<Human>().All(x => !x.Alive)))
            {
                Victorious = true;
                world.score += (1000 - world.timer / 6);
                if (world.timer / 60 < 15)
                {
                    Achievements.Achieve("speedhunt");
                }
                if (world.DarkMode)
                {
                    Achievements.Achieve("finishdark");
                }
                if (world.killedAtLeast3BeforeAlarm)
                {
                    Achievements.Achieve("kill3withoutalarm");
                }
                if (world.killedAllAfterAlarm)
                {
                    Achievements.Achieve("killallafteralarm");
                }
            }

            if (!paused)
            {
                world.Update();
            }
            else
            {
                if (RM.IsPressed(InputAction.Accept))
                {
                    g.Showscreen(new MainMenuScreen());
                }
            }

            if (Victorious && RM.IsPressed(InputAction.Accept))
            {
                currentLevel++;
                if (currentLevel >= RM.Levels.Count)
                {
                    currentLevel = 0;
                }

                world = new World(RM.Levels[currentLevel]);
                Victorious = false;
            }

            if (RM.IsPressed(InputAction.Back))
            {
                paused = !paused;
            }

            if (RM.NextMusic.Count <= 0)
            {
                if (Victorious)
                {
                    RM.NextMusic.Enqueue("music4");
                    RM.NextMusic.Enqueue("music4");
                    RM.NextMusic.Enqueue("music4");
                    RM.NextMusic.Enqueue("music3");
                }
                else if (world.IsAlarmRinging)
                {
                    RM.NextMusic.Enqueue("music3");
                    RM.NextMusic.Enqueue("music3");
                    RM.NextMusic.Enqueue("music3");
                    RM.NextMusic.Enqueue("music4");
                }
                else
                {
                    RM.NextMusic.Enqueue("music2");
                }
            }

            // camera.position.Y = island.CheckHeightCollision(camera.position);
        }
예제 #4
0
파일: GameScreen.cs 프로젝트: Frib/LD25
 public GameScreen(int level)
 {
     camera = new Camera3d();
     world = new World(RM.Levels[level]);
     currentLevel = level;
 }
예제 #5
0
파일: Pathnode.cs 프로젝트: Frib/LD25
 public Pathnode(World world)
 {
     HudIcons.Add(new HudIcon() { texture = RM.GetTexture("escapeicon"), text = "Evac point", Action = () => EvacPoint = !EvacPoint });
     HudIcons.Add(new HudIcon() { texture = RM.GetTexture("deleteicon"), text = "Remove", Action = () => { world.Pathnodes.Remove(this); LinkedNodes.ForEach(l => l.LinkedNodes.Remove(this)); LinkedNodes.Clear(); world.SelectedNode = null; } });
 }
예제 #6
0
파일: Pathnode.cs 프로젝트: Frib/LD25
 internal static Pathnode Create(World w, string p)
 {
     var split = p.Split(':');
     return new Pathnode(w) { EvacPoint = split[0] == "1",  Location = new Vector2(int.Parse(split[1].Split(',')[0]), int.Parse(split[1].Split(',')[1])) };
 }