public void init(int livesLeft, GameTime gameTime) { initAt = gameTime.TotalGameTime.TotalSeconds; this.livesLeft = livesLeft; PhysicsEngine.objects = gameObjects; bug = new MonsterObject(bugZilla, screenWidth / 2, screenHeight - 220, 70, 100); player = new Player(character, 10, 410, jump); gameObjects.Add(exit); gameObjects.Add(helmet); knowsPowerup = false; updateCount = 0; }
public void init(int livesLeft, GameTime gameTime) { initAt = gameTime; this.livesLeft = livesLeft; isStartup = true; gameobjects.Add(exit); bug = new MonsterObject(bugZilla, screenWidth / 2, screenHeight - 120, 70, 100); player = new Player(character, 10, screenHeight - 130, jump); CollectibleObject temp = new CollectibleObject(openComment, 300, 100, 40, 40); temp.setSound(collect); gameobjects.Add(temp); temp = new CollectibleObject(closeComment, screenWidth - 300, screenHeight - 100, 40, 40); temp.setSound(collect); gameobjects.Add(temp); scene = story.ElementAt(0); }
public void LoadContent(GraphicsDevice graphicsDevice, GraphicsDeviceManager graphics, ContentManager content) { spriteBatch = new SpriteBatch(graphicsDevice); life = content.Load<Texture2D>(@"life"); screenHeight = graphics.GraphicsDevice.Viewport.Height; screenWidth = graphics.GraphicsDevice.Viewport.Width; background = content.Load<Texture2D>(@"background"); theCreator = content.Load<Texture2D>(@"theCreator"); openComment = content.Load<Texture2D>(@"open_comment"); closeComment = content.Load<Texture2D>(@"close_comment"); brick = content.Load<Texture2D>(@"brick"); bugZilla = content.Load<Texture2D>(@"bug"); bug = new MonsterObject(bugZilla, screenWidth / 2, screenHeight - 120, 70, 100); bug.setFrameSize(70, 100); bug.setCollisionBox(screenWidth / 2 , screenHeight - 120, 70, 100); character = content.Load<Texture2D>("sprite_sheet_without"); collect = content.Load<SoundEffect>(@"collect"); jump = content.Load<SoundEffect>(@"jump"); player = new Player(character, 10, screenHeight - 130, jump); exit = new ExitObject(content.Load<Texture2D>(@"exit"), screenWidth - 90, screenHeight - 80, 50, 60); gameobjects.Add(exit); gameobjects.Add(new CollidableObject(content.Load<Texture2D>(@"tree"), screenWidth - 320, screenHeight - 400, 200, 380, 200, 100)); gameobjects.Add(new CollidableObject(content.Load<Texture2D>(@"branch"), screenWidth - 370, screenHeight - 320, 50, 60)); InteractiveObject cow = new InteractiveObject(content.Load<Texture2D>(@"cow"), screenWidth - 220, screenHeight - 475, 120, 80); cow.setInteractions(content.Load<Texture2D>(@"dialog_12"), content.Load<Texture2D>(@"dialog_11"), content.Load<Texture2D>(@"dialog_13")); gameobjects.Add(cow); CollectibleObject temp = new CollectibleObject(openComment, 300, 100, 40, 40); temp.setSound(collect); gameobjects.Add(temp); temp = new CollectibleObject(closeComment, screenWidth - 300, screenHeight - 100, 40, 40); temp.setSound(collect); gameobjects.Add(temp); gameobjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 20)); gameobjects.Add(new Ledge(brick, 320, 480, screenHeight - 150)); gameobjects.Add(new Ledge(brick, screenWidth / 2, screenWidth / 2 + 160, screenHeight - 250)); gameobjects.Add(new Ledge(brick, screenWidth / 2 - 80, screenWidth / 2 + 80, screenHeight - 400)); gameobjects.Add(new Ledge(brick, screenWidth / 2 - 180, screenWidth / 2 - 100, screenHeight - 500)); LoadStoryBoards(content); }
public void LoadContent(GraphicsDevice graphicsDevice, GraphicsDeviceManager graphics, ContentManager content) { screenHeight = graphics.GraphicsDevice.Viewport.Height; screenWidth = graphics.GraphicsDevice.Viewport.Width; life = content.Load<Texture2D>(@"life"); character = content.Load<Texture2D>(@"sprite_sheet_arms"); jump = content.Load<SoundEffect>(@"jump"); player = new Player(character, 10, 410, jump); devDialog = content.Load<Texture2D>(@"dialog_43"); playerDialog = content.Load<Texture2D>(@"dialog_41"); creator = content.Load<Texture2D>(@"theCreator"); dragon = new MonsterObject(content.Load<Texture2D>(@"dragon"), screenWidth / 2 - 250, screenHeight - 580, 550, 250, 0); dragon.setFrameSize(539, 389); dragon.setCollisionBox(screenWidth / 2 - 120, screenHeight - 580, 240, 250); spriteBatch = new SpriteBatch(graphicsDevice); brick = content.Load<Texture2D>(@"brick"); background = content.Load<Texture2D>(@"background"); bugZilla = content.Load<Texture2D>(@"bug"); bug = new MonsterObject(bugZilla, screenWidth / 2, screenHeight - 220, 70, 100); exit = new ExitObject(content.Load<Texture2D>(@"exit"), screenWidth - 90, screenHeight - 260, 50, 60); helmet = new CollectibleObject(content.Load<Texture2D>(@"helmet"), 250, 300, 70, 70); gameObjects.Add(helmet); gameObjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 20)); gameObjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 40)); gameObjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 60)); gameObjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 80)); gameObjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 100)); gameObjects.Add(new Ledge(brick, 0, screenWidth, screenHeight - 120)); gameObjects.Add(new Ledge(brick, 0, screenWidth/2 - 120, screenHeight - 140)); gameObjects.Add(new Ledge(brick, screenWidth/2 + 120, screenWidth, screenHeight - 140)); gameObjects.Add(new Ledge(brick, 0, screenWidth / 2 - 120, screenHeight - 160)); gameObjects.Add(new Ledge(brick, screenWidth / 2 + 120, screenWidth, screenHeight - 160)); gameObjects.Add(new Ledge(brick, 0, screenWidth/2 - 280, screenHeight - 180)); gameObjects.Add(new Ledge(brick, screenWidth/2 + 280, screenWidth, screenHeight - 180)); gameObjects.Add(new Ledge(brick, 0, screenWidth / 2 - 280, screenHeight - 200)); gameObjects.Add(new Ledge(brick, screenWidth / 2 + 280, screenWidth, screenHeight - 200)); gameObjects.Add(new Ledge(brick, screenWidth /2 - 280, screenWidth/2 + 280, screenHeight - 330)); gameObjects.Add(exit); LoadStoryBoards(content); }