public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "jett_loaf_x48", 2, 1); sprite.Add(animation, 0, 0); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. SpriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here player.Load(Content); enemy.Load(Content); var ViewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, ScreenWidth, ScreenHeight); Camera = new Camera2D(ViewportAdapter); Camera.Position = new Vector2(0, ScreenHeight); Map = Content.Load <TiledMap>("Level1"); foreach (TiledTileLayer Layer in Map.TileLayers) { if (Layer.Name == "Collisions") { CollisionLayer = Layer; } } Arialfont = Content.Load <SpriteFont>("Arial"); Heart = Content.Load <Texture2D>("Heart"); AIE.StateManager.CreateState("Splash", new SplashState()); AIE.StateManager.CreateState("Game", new GameState()); AIE.StateManager.CreateState("GamerOver", new GameOverState()); AIE.StateManager.PushState("Splash"); foreach (TiledObjectGroup Group in Map.ObjectGroups) { if (Group.Name == "Enemies") { foreach (TiledObject Obj in Group.Objects) { Enemy enemy = new Enemy(this); enemy.Load(Content); enemy.Position = new Vector2(Obj.X, Obj.Y); Enemies.Add(enemy); } } if (Group.Name == "Goal") { TiledObject Obj = Group.Objects[0]; if (Obj != null) { AnimatedTexture Anim = new AnimatedTexture(Vector2.Zero, 0, 1, 1); Anim.Load(Content, "Goal", 1, 1); Goal = new Sprite(); Goal.Add(Anim, 0, 5); Goal.position = new Vector2(Obj.X, Obj.Y); } } } GameMusic = Content.Load <Song>("SuperHero_original_no_Intro"); MediaPlayer.Play(GameMusic); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 20, 1); animation.Load(content, "fadein", 11, 11); sprite.Add(animation, 0, 0); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 2, 1); animation.Load(content, "heart_x16", 1, 1); sprite.Add(animation, 0, 0); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 0.6f, 1); animation.Load(content, "jett_run_x48", 2, 5); sprite.Add(animation, 4, -10); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "enemy", 1, 1); enemySprite.Add(animation, 0, -32); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "lock_x32", 3, 10); sprite.Add(animation, 0, 0); }
private void Start() { player.SetPosition(new Vector2(64, 448)); score = 0; enemies.Clear(); foreach (TiledMapObjectLayer layer in map.ObjectLayers) { if (layer.Name == "Enemies") { foreach (TiledMapObject obj in layer.Objects) { Enemy enemy = new Enemy(this); enemy.Load(Content); enemy.Position = new Vector2( obj.Position.X, obj.Position.Y); enemies.Add(enemy); } } if (layer.Name == "Goal") { TiledMapObject obj = layer.Objects[0]; if (obj != null) { AnimatedTexture anim = new AnimatedTexture( Vector2.Zero, 0, 1, 1); anim.Load(Content, "goal", 1, 1); goal = new Sprite(); goal.Add(anim, 0, -32); goal.position = new Vector2( obj.Position.X, obj.Position.Y); } } } }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "zombie", 4, 5); sprite.Add(animation, 16, 0); }
public void Load(ContentManager content) { AnimatedTexture walkAni = new AnimatedTexture(Vector2.Zero, 0, 1, 1); walkAni.Load(content, "player_walk_x48", 4, 10); walk.Add(walkAni, 4, -10); jump = content.Load <SoundEffect>("jump"); }
public void Load(ContentManager Content) { AnimatedTexture Animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); Animation.Load(Content, "Enemy", 4, 5); Sprite.Add(Animation, 16, 0); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here player.Load(Content); arialFont = Content.Load <SpriteFont>("Arial"); heart = Content.Load <Texture2D>("heart"); var viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, (int)(graphics.GraphicsDevice.Viewport.Width), (int)(graphics.GraphicsDevice.Viewport.Height)); camera = new Camera2D(viewportAdapter); camera.Position = player.Position - new Vector2(ScreenWidth, ScreenHeight); map = Content.Load <TiledMap>("Level1"); foreach (TiledTileLayer layer in map.TileLayers) { if (layer.Name == "Collisions") { collisionLayer = layer; } } foreach (TiledObjectGroup group in map.ObjectGroups) { if (group.Name == "enemies") { foreach (TiledObject obj in group.Objects) { Enemy enemy = new Enemy(this); enemy.Load(Content); enemy.Position = new Vector2(obj.X, obj.Y); enemies.Add(enemy); } } if (group.Name == "goal") { TiledObject obj = group.Objects[0]; if (obj != null) { AnimatedTexture anim = new AnimatedTexture( Vector2.Zero, 0, 1, 1); anim.Load(Content, "chest", 1, 1); goal = new Sprite(); goal.Add(anim, 0, 5); goal.position = new Vector2(obj.X, obj.Y); } } } gameMusic = Content.Load <Song>("Superhero_Violin"); MediaPlayer.Play(gameMusic); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, scale, 1); animation.Load(content, "coin", 12, 5); sprite.scale = scale; sprite.Add(animation, 0, 5); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "ghost_walk_x48", 4, 5); sprite.Add(animation, -8, -10); fireTexture = content.Load <Texture2D>("spark"); fireEmitter = new Emitter(fireTexture, Position); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, scale, 1); animation.Load(content, "enemy", 5, 5); sprite.scale = scale; //setting the sprite scale (used for bounds) to the enemy scale sprite.Add(animation, 0, 4); }
public void Load(ContentManager Content) { AnimatedTexture Animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); Animation.Load(Content, "walk", 12, 20); JumpSound = Content.Load <SoundEffect>("Jump"); // yes JumpSoundInstance = JumpSound.CreateInstance(); sprite.Add(Animation, 0, -5); sprite.Pause(); }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "walk", 12, 20); jumpSound = content.Load <SoundEffect>("Jump"); jumpSoundInsance = jumpSound.CreateInstance(); sprite.Add(animation, 0, -5); sprite.Pause(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); player.Load(Content); var ViewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, ScreenWidth, ScreenHeight); camera = new Camera2D(ViewportAdapter); camera.Position = new Vector2(0, ScreenHeight); map = Content.Load <TiledMap>("Level1"); foreach (TiledTileLayer layer in map.TileLayers) { if (layer.Name == "Collisions") { collisionLayer = layer; } gameMusic = Content.Load <Song>("SuperHero_original_no_Intro"); MediaPlayer.Play(gameMusic); } foreach (TiledObjectGroup group in map.ObjectGroups) { if (group.Name == "Enemies") { foreach (TiledObject obj in group.Objects) { Enemy enemy = new Enemy(this); enemy.Load(Content); enemy.Position = new Vector2(obj.X, obj.Y); enemies.Add(enemy); } } Debug.WriteLine(group.Name); if (group.Name == "Goal") { TiledObject obj = group.Objects[0]; if (obj != null) { AnimatedTexture anim = new AnimatedTexture(Vector2.Zero, 0, 1, 1); anim.Load(Content, "chest", 1, 1); goal = new Sprite(); goal.Add(anim, 0, 5); goal.position = new Vector2(obj.X, obj.Y); } } // TODO: use this.Content to load your game content here } }
public void Load(ContentManager content) { AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, scale, 1); animation.Load(content, "DudeWalking", 9, 13); sprite.scale = scale; //setting the sprite scale(used for bounds) to the player scale sprite.Add(animation, 0, 1); sprite.Pause(); jumpSound = content.Load <SoundEffect>("Jump"); jumpSoundInstance = jumpSound.CreateInstance(); }
public void Load(ContentManager content) { //sprite.Load(content, "player_stand"); AnimatedTexture animation = new AnimatedTexture(Vector2.Zero, 0, 1, 1); animation.Load(content, "player_walk1", 12, 20); jumpSound = content.Load <SoundEffect>("SFX/Jump"); jumpSoundInstance = jumpSound.CreateInstance(); jumpSoundInstance.Volume = 0.5f; sprite.Add(animation, 0, -5); }
private void Restart() { foreach (TiledTileLayer layer in map.TileLayers) { if (layer.Name == "Collisions") { collisionLayer = layer; } gameMusic = Content.Load <Song>("SuperHero_original_no_Intro"); MediaPlayer.Play(gameMusic); } foreach (TiledObjectGroup group in map.ObjectGroups) { if (group.Name == "Enemies") { foreach (TiledObject obj in group.Objects) { Enemy enemy = new Enemy(this); enemy.Load(Content); enemy.Position = new Vector2(obj.X, obj.Y); enemies.Add(enemy); } } Debug.WriteLine(group.Name); if (group.Name == "Goal") { TiledObject obj = group.Objects[0]; if (obj != null) { AnimatedTexture anim = new AnimatedTexture(Vector2.Zero, 0, 1, 1); anim.Load(Content, "chest", 1, 1); goal = new Sprite(); goal.Add(anim, 0, 5); goal.position = new Vector2(obj.X, obj.Y); } } // TODO: use this.Content to load your game content here } }
public void Add(AnimatedTexture Animation, int XOffSet = 0, int YOffSet = 0) { Animations.Add(Animation); AnimationOffSets.Add(new Vector2(XOffSet, YOffSet)); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); player.Load(Content); candaraFont = Content.Load <SpriteFont>("Candara"); heart = Content.Load <Texture2D>("heart"); BoxingViewportAdapter viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, ScreenWidth, ScreenHeight); camera = new Camera2D(viewportAdapter); camera.Position = new Vector2(0, ScreenHeight); gameMusic = Content.Load <Song>("Music/SuperHero_original_no_Intro"); MediaPlayer.Volume = 0.1f; MediaPlayer.Play(gameMusic); map = Content.Load <TiledMap>("samp1"); mapRenderer = new TiledMapRenderer(GraphicsDevice); foreach (TiledMapTileLayer layer in map.TileLayers) { if (layer.Name == "Collisions") { collisionLayer = layer; } } foreach (TiledMapObjectLayer layer in map.ObjectLayers) { if (layer.Name == "Enemies") { foreach (TiledMapObject obj in layer.Objects) { Enemy enemy = new Enemy(this); enemy.Load(Content); enemy.Position = new Vector2(obj.Position.X, obj.Position.Y); enemies.Add(enemy); } } if (layer.Name == "Loot") { TiledMapObject obj = layer.Objects[0]; if (obj != null) { AnimatedTexture anim = new AnimatedTexture(Vector2.Zero, 0, 1, 1); anim.Load(Content, "gem_3", 1, 1); gem = new Sprite(); gem.Add(anim, 0, 5); gem.position = new Vector2(obj.Position.X, obj.Position.Y); } } } // TODO: use this.Content to load your game content here }
public void Add(AnimatedTexture animation, int xOffset = 0, int yOffset = 0) { animations.Add(animation); animationOffsets.Add(new Vector2(xOffset, yOffset)); }
public void Load(ContentManager c) { AnimatedTexture sprite = new AnimatedTexture(Vector2.Zero, 0, 1, 1); }