コード例 #1
0
ファイル: Chest.cs プロジェクト: endy/OgmoXNA
 public Chest(OgmoObject obj, Level level)
     : base(obj, level)
 {
     OgmoIntegerValue coins = obj.GetValue<OgmoIntegerValue>("coins");
     if (coins != null)
         this.Coins = coins.Value;
     this.Collision += new EventHandler<CollisionEventArgs>(Chest_Collision);
 }
コード例 #2
0
ファイル: GameObject.cs プロジェクト: endy/OgmoXNA
 protected GameObject(OgmoObject obj, Level level)
 {
     this.Level = level;
     this.Height = obj.Height;
     this.Name = obj.Name;
     this.Origin = obj.Origin;
     this.Position = obj.Position;
     this.Source = obj.Source;
     this.Texture = obj.Texture;
     this.Width = obj.Width;
     this.IsTiled = obj.IsTiled;
 }
コード例 #3
0
ファイル: MovingPlatform.cs プロジェクト: endy/OgmoXNA
 public MovingPlatform(OgmoObject obj, Level level)
     : base(obj, level)
 {
     nodes.AddRange(obj.Nodes);
     if (nodes.Count > 0)
     {
         direction = Vector2.Normalize(nodes[currentNode].Position - this.Position);
         nodes.Add(new OgmoNode(this.Position));
     }
     OgmoNumberValue speedValue = obj.GetValue<OgmoNumberValue>("speed");
     if (speedValue != null)
         speed = speedValue.Value;
 }
コード例 #4
0
ファイル: OgmoXNADemoGame.cs プロジェクト: endy/OgmoXNA
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(this.GraphicsDevice);

            // Load our level using the game's content manager.  The project specified in the content processor
            // properties for this level, along with all the texture assets, will be built and loaded.
            level = new Level(this.Content.Load<OgmoLevel>(@"levels\demo\demoLevel"));
            // Load the level's font so we can show off how many coins we have gathered.
            level.Load(this.Content);
        }
コード例 #5
0
ファイル: Ogmo.cs プロジェクト: endy/OgmoXNA
 public Ogmo(OgmoObject obj, Level level)
     : base(obj, level)
 {
     startPosition = obj.Position;
     this.Die += new EventHandler(Ogmo_Die);
 }
コード例 #6
0
ファイル: Spike.cs プロジェクト: endy/OgmoXNA
 public Spike(OgmoObject obj, Level level)
     : base(obj, level)
 {
     this.Collision += new EventHandler<CollisionEventArgs>(Spike_Collision);
 }