Exemple #1
0
        public GameScene(int level, int numPlayers)
        {
            OgmoProject project = new OgmoProject(AssetManager.OgmoProject, AssetManager.OgmoImagePath);
            project.RegisterTag((int)CollisionTag.Wall, "Walls");
            project.RegisterTag((int)CollisionTag.Brick, "Bricks");
            project.RegisterTag((int)CollisionTag.Player, "Players");

            if (level != 1)
                throw new NotSupportedException();

            project.LoadLevel("Assets/Levels/Standard.oel", this);
        }
Exemple #2
0
        public PlatformerScene()
            : base()
        {
            // Create the Ogmo Editor project.
            var ogmoProject = new OgmoProject("OgmoProject.oep");

            // Register the "Solid" layer with the tag Solid.
            ogmoProject.RegisterTag(CollisionTag.Solid, "Solid");

            // Set the game's color to the Ogmo Project's background color.
            Game.Instance.Color = ogmoProject.BackgroundColor;

            // Load the level.
            ogmoProject.LoadLevel("Level.oel", this);
        }
Exemple #3
0
        public TestingMode()
        {
            //tank entity creation was moved to ogmo; see testlevel.oep for adding a decorator to your tank.
            //try to load a project
            OgmoProject proj = new OgmoProject("Resources/Maps/test.oep", "Resources/Maps/");

            //register our function to call for creating entities
            //this just is a string with the method name, the method itself has to be in the entities (see tank)
            proj.CreationMethodName = _creationMethodName;

            //uuh this somehow "registers a collision tag"
            proj.RegisterTag(CollidableTags.Wall, "CollisionLayer");

            //try to load a level into "Scene"
            proj.LoadLevel("Resources/Maps/collisionTestBench.oel", Scene);
        }
Exemple #4
0
        private void LoadMap(Maps map)
        {
            //tank entity creation was moved to ogmo; see testlevel.oep for adding a decorator to your tank.
            //try to load a project
            OgmoProject proj = new OgmoProject("Resources/Maps/test.oep", "Resources/Maps/");

            //register our function to call for creating entities
            //this just is a string with the method name, the method itself has to be in the entities (see tank)
            proj.CreationMethodName = _creationMethodName;

            //uuh this somehow "registers a collision tag"
            proj.RegisterTag(CollidableTags.Wall, "CollisionLayer");

            //try to load a level into "Scene"; map gets auto-ToString() to enum position name
            proj.LoadLevel("Resources/Maps/" + map + ".oel", Scene);
        }
Exemple #5
0
        private void LoadMap(Maps map)
        {
            //tank entity creation was moved to ogmo; see testlevel.oep for adding a decorator to your tank.
            //try to load a project, second path is image path. it goes into maps because ogmo instructs to go up a level, so we end up in resources
            OgmoProject proj = new OgmoProject("Resources/Maps/test.oep", "Resources/Maps/");

            //register our function to call for creating entities
            //this just is a string with the method name, the method itself has to be in the entities (see tank)
            proj.CreationMethodName = _creationMethodName;

            //uuh this somehow "registers a collision tag"
            proj.RegisterTag(CollidableTags.Wall, "CollisionLayer");

            //try to load a level into "Scene"
            proj.LoadLevel("Resources/Maps/"+map+".oel", Scene);
        }