protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); _bitmapFont = Content.Load<BitmapFont>("Fonts/courier-new-32"); _tiledMap = Content.Load<TiledMap>("Tilesets/test-tileset-left-up"); _world = new CollisionWorld(new Vector2(0, 900)); _world.CreateGrid(_tiledMap.GetLayer<TiledTileLayer>("Tile Layer 1")); var zombieAnimator = Content.Load<SpriteSheetAnimator>("Sprites/zombie-animations"); _zombie = new Zombie(zombieAnimator); var zombieActor = _world.CreateActor(_zombie); zombieActor.Position = new Vector2(462.5f, 896f); }
protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); _bitmapFont = Content.Load<BitmapFont>("Fonts/courier-new-32"); _tiledMap = Content.Load<TiledMap>("level01"); var fireballTexture = Content.Load<Texture2D>("fireball"); var spriteSheetAtlas = TextureAtlas.Create(fireballTexture, 512, 197); _sprite = new Sprite(spriteSheetAtlas.First()) { Position = new Vector2(850, 200), Scale = new Vector2(0.5f) }; _spriteAnimator = new SpriteAnimator(_sprite, spriteSheetAtlas, 15); var zombieSheet = Content.Load<TextureAtlas>("zombie-atlas"); _zombie = new Zombie(zombieSheet) { Position = new Vector2(300, 900) }; }
protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); _bitmapFont = Content.Load<BitmapFont>("Fonts/courier-new-32"); _tiledMap = Content.Load<TiledMap>("Tilesets/level01"); _world.CreateGrid(_tiledMap.GetLayer<TiledTileLayer>("Tile Layer 1")); var fireballTexture = Content.Load<Texture2D>("Sprites/fireball"); var spriteSheetAtlas = TextureAtlas.Create(fireballTexture, 512, 197); _sprite = new Sprite(spriteSheetAtlas[0]) { Position = new Vector2(850, 200), Scale = new Vector2(0.5f) }; _spriteAnimator = new SpriteAnimator(_sprite, spriteSheetAtlas, 15); var zombieSheet = Content.Load<TextureAtlas>("Sprites/zombie-atlas"); _zombie = new Zombie(zombieSheet); var zombieActor = _world.CreateActor(_zombie); zombieActor.Position = new Vector2(300, 900); }