protected override void Load() { tileEngine = new TileEngine("Content/tileTexturetest"); AddComponent(tileEngine); }
public void Initialize(MainGame game) { GameRef = game; Camera = new Camera(); TileEngine = new TileEngine(32,32,game); }
protected override void Load() { // TODO: Test worked, no just put it to use content pipeline // Load each tile used in map and ask for a TileList TileLoader loader = new TileLoader("Content/XMLmap/testi.xml", Engine.Content); TileList list = loader.GetTileList(); // Load all the layers from file and ask for a maplayer list LayerLoader layerLoader = new LayerLoader("Content/XMLmap/layertesti.xml", list); List<MapLayer> layers = layerLoader.GetLayerList(); tileEngine = new TileEngine(32, 32, Engine.GameRef); // Make map with all those layers Session.CurrentMap = new TileMap(layers); // Add components and controls etc animations = new Dictionary<AnimationKey, Animation>(); ; Texture2D playerTexture = Engine.Content.Load<Texture2D>("content/Sprites/malefighter"); Animation animation = new Animation(3, 28, 28, 0, 0); animations.Add(AnimationKey.Down, animation); animation = new Animation(3, 28, 28, 0, 28); animations.Add(AnimationKey.Left, animation); animation = new Animation(3, 28, 28, 0, 56); animations.Add(AnimationKey.Right, animation); animation = new Animation(3, 28, 28, 0, 84); animations.Add(AnimationKey.Up, animation); playerSprite = new AnimatedSprite(playerTexture, animations); playerSprite.IsAnimating = true; AddComponent(playerSprite); SpriteFont spriteFont = Engine.Content.Load<SpriteFont>("Content/Fonts/Georgia"); Label text = new Label(spriteFont, Engine.SpriteBatch); text.Text = "HakaGame 1.0"; text.Size = spriteFont.MeasureString(text.Text); text.Position = new Vector2(100, 100); Controls.Add(text); base.Load(); }