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); screenHeight = graphics.GraphicsDevice.Viewport.Height; screenWidth = graphics.GraphicsDevice.Viewport.Width; life = content.Load<Texture2D>(@"life"); background = content.Load<Texture2D>(@"background"); character = content.Load<Texture2D>(@"sprite_sheet_arms"); theCreator = content.Load<Texture2D>(@"theCreator"); brick = content.Load<Texture2D>(@"brick"); shark = content.Load<Texture2D>(@"shark"); code = content.Load<Texture2D>(@"code"); ground = content.Load<Texture2D>(@"ground"); ledge_error = content.Load<Texture2D>(@"ledge_error"); portal1 = content.Load<Texture2D>(@"portal1"); portal2 = content.Load<Texture2D>(@"portal2"); cursor = content.Load<Texture2D>(@"Cursor"); jump = content.Load<SoundEffect>(@"jump"); dead = content.Load<SoundEffect>(@"dead"); playerDialog = content.Load<Texture2D>(@"dialog_21"); devStartDialog = content.Load<Texture2D>(@"dialog_22"); player = new Player(character, 10, 350, jump); exit = new ExitObject(content.Load<Texture2D>(@"exit"), screenWidth - 90, 400, 50, 60); devDialog = content.Load<Texture2D>(@"dialog_23"); gun = new CollectibleObject(content.Load<Texture2D>(@"portal_gun"), 140, 350, 60, 40); gun.setSound(content.Load<SoundEffect>(@"collect")); collidableObjects.Add(gun); collidableObjects.Add(exit); for(int i = 0; i < 241; i=i+20) collidableObjects.Add(new Ledge(brick, 0, 360, 460+i)); for (int i = 0; i < 241; i = i + 20) collidableObjects.Add(new Ledge(brick, 880, screenWidth, 460 + i)); }
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); }