public Door(ContentManager content, int x, int y, int w, int h, string vict, string d) : base(x, y, w, h) { destination = d; state = State.closed; time = new Stopwatch(); frameTime = new Stopwatch(); frameTime.Start(); sprite = new AnimatedTexture(content, @"ContentFiles/Images/Sprites/DoorSliding", 7, 1); frameSprite = new AnimatedTexture(content, @"ContentFiles/Images/Sprites/DoorFrame", 11, .01f); if (vict == "true") { victory = true; } }
public EnemyW(ContentManager Content, int x, int y, int w, int h, Player p) : base(Content, x, y, w, h, p) { grav = gravDirection.Down; gravity = GameVariables.gravity; currentDir = myDirection.right; xVelocity = 0; yVelocity = 0; inAir = true; alive = true; isDangerous = true; origin = new Point(x, y); Move = new AnimatedTexture(Content, @"ContentFiles/Images/Sprites/enemyw_sri", 4, .1f); vision = new Rectangle(0, 0, 100, 500); atime = new Stopwatch(); player = p; }
public Enemy(ContentManager Content, int x, int y, int w, int h, Player p) : base(x, y, w, h) { grav = gravDirection.Down; gravity = GameVariables.gravity; currentDir = myDirection.right; xVelocity = 0; yVelocity = 0; inAir = true; alive = true; origin = new Point(x, y); isDangerous = true; player = p; Move = new AnimatedTexture(Content, @"ContentFiles/Images/Sprites/enemy_sri", 10, 1f); atime = new Stopwatch(); enemyEmitter = new AudioEmitter(); enemyEmitter.Position = new Vector3(x, y, 0.0f); }
/// <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.LoadContent(Content); GameVariables.LoadContentFiles(Content); // TODO: use this.Content to load your game content here pauseBack = Content.Load<Texture2D>(GameVariables.imgWall); gameFont = Content.Load<SpriteFont>(GameVariables.gFont); gameFont2 = Content.Load<SpriteFont>(GameVariables.gFont2); deathScreen = Content.Load<Texture2D>(@"ContentFiles/Images/Sprites/death"); victoryScreen = Content.Load<Texture2D>(@"ContentFiles/Images/Sprites/Victory"); menu = new AnimatedTexture(Content, @"ContentFiles/Images/Sprites/fronta", 5, .05f); world = new World(GameVariables.menuWorld, s, player, Content); // Menu "world" world.LoadWorld(); player.ObjPos.X = world.levels["main.txt"].playerSpawn.X; player.ObjPos.Y = world.levels["main.txt"].playerSpawn.Y; world.currentLevel = "main.txt"; moveCamera = new Camera(player, GraphicsDevice); gameHUD = new Hud((int)moveCamera.camX + 20, (int)moveCamera.camY + 20, 300, 45, spriteBatch, player, moveCamera, world.levels[world.currentLevel]); falling = new SoundLoop(GameVariables.fallingLoopInstance1, 700, GameVariables.fallingLoopInstance2, 700, GameVariables.fallingAccelerationInstance, 850); robotMovement = new SoundLoop(GameVariables.robotSoundInstance1, 690, GameVariables.robotSoundInstance2, 690); gameHUD.backt = Content.Load<Texture2D>(@"ContentFiles/Images/Sprites/back"); gameHUD.undert = Content.Load<Texture2D>(@"ContentFiles/Images/Sprites/grey"); gameHUD.energyt = Content.Load<Texture2D>(@"ContentFiles/Images/Sprites/energy"); }