示例#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
 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
 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
        /// <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);
 }