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); }
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; }
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; }
/// <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); }
public Ogmo(OgmoObject obj, Level level) : base(obj, level) { startPosition = obj.Position; this.Die += new EventHandler(Ogmo_Die); }
public Spike(OgmoObject obj, Level level) : base(obj, level) { this.Collision += new EventHandler<CollisionEventArgs>(Spike_Collision); }