コード例 #1
0
ファイル: GameScene.cs プロジェクト: patHyatt/Frenemey
        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);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: JOCP9733/tank
        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);
        }
コード例 #3
0
ファイル: TestingMode.cs プロジェクト: JOCP9733/tank
        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);
        }
コード例 #4
0
ファイル: LocalMultiplayer.cs プロジェクト: JOCP9733/tank
        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);
        }
コード例 #5
0
        static void Main(string[] args)
        {
            // Create a new Game.
            var game = new Game("Ogmo Editor Example");
            // Set the background color to see stuff a little better.
            game.Color = Color.Cyan;

            // Create a new Scene to use for the Ogmo data.
            var scene = new Scene();

            // The path to the level to be loaded.
            var pathLevel = "Level.oel";
            // The path to the Ogmo Project to use when loading the level.
            var pathProject = "OgmoProject.oep";

            // Create a new OgmoProject using the .oep file.
            var OgmoProject = new OgmoProject(pathProject);

            // Ensure that the grid layer named "Solids" gets the Solid collision tag when loading.
            OgmoProject.RegisterTag(Tags.Solid, "Solids");

            // Load the level into the Scene.
            OgmoProject.LoadLevelFromFile(pathLevel, scene);

            // Start the game using the Scene with the loaded Ogmo Level.
            game.Start(scene);
        }
コード例 #6
0
ファイル: NetworkMultiplayer.cs プロジェクト: JOCP9733/tank
        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);
        }