public void SpawnNextlevel(Hans hans) { if (hans.position.X < center.X) { SpawnNextlvl = true; } }
private void UpdateStats(Hans hans) { //for now we only do linear stat updates foreach (var(stat, value) in StatChanges) { var amount = value / InitialDuration; hans.Stats[stat] += amount; } }
public void Run(Hans hans) { if (TicksLeft > 0) { TicksLeft -= 1; UpdateStats(hans); if (TicksLeft == 0) { OnComplete(hans); } } else { throw new Exception("Activity has no more ticks left, should not be run"); } }
public void HansGottaEat() { var restaurant = new Location("Restaurant") { LocationFeatures = new[] { LocationFeature.Table } }; var hans = new Hans("Peter") { Location = restaurant }; Assert.Equal(70, hans.Stats[Satiety]); hans.AddActivity(Activity.Eat(), restaurant); hans.Tick(); Assert.Equal(86, hans.Stats[Satiety]); }
public void ScheduleActivity(Hans hans, Activity activity, Location location) { hans.AddActivity(activity, location); }
/// <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 textur font = Content.Load <SpriteFont>("Arial"); spriteBatch = new SpriteBatch(GraphicsDevice); grietjeTex = Content.Load <Texture2D>("Pixel"); hansTex = Content.Load <Texture2D>("Ht"); pftexture = Content.Load <Texture2D>("Pfblok"); stonetex = Content.Load <Texture2D>("GFX\\Level\\Assets\\schuif_steen"); crushstone = Content.Load <Texture2D>("GFX\\Sheets\\breek_steen_1_test"); fallStone = Content.Load <Texture2D>("blok_p1"); startscreen = new StartScreen(); startscreen.LoadContent(Content); game_over = Content.Load <Texture2D>("GFX\\achtergrond"); laddertextures = new Texture2D[] { ladder11Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder11"), ladder10Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder10"), ladder9Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder9"), ladder8Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder8"), ladder7Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder7"), ladder6Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder6"), ladder5Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder5"), ladder4Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder4"), ladder3Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder2"), ladder2Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder3"), ladder1Tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\Ladders\\ladder1"), }; pullLever = Content.Load <SoundEffect>("GFX\\Hans\\HansSounds\\i_am_gonna_pull_the_lever"); bgm = Content.Load <Song>("Sound\\MytheV6"); credits = Content.Load <Song>("Sound\\CreditsV1Loop"); startbgm = Content.Load <Song>("Sound\\StartscreenV1loop2"); MediaPlayer.IsRepeating = true; MediaPlayer.Play(startbgm); //assets sounds lever = Content.Load <SoundEffect>("GFX\\Level\\Assets\\AssetsSound\\Lever01"); levercreak = Content.Load <SoundEffect>("GFX\\Level\\Assets\\AssetsSound\\Lever02_Creak"); rockdrag = Content.Load <Song>("GFX\\Level\\Assets\\AssetsSound\\Rockdrag_01_01"); rocksmash1 = Content.Load <SoundEffect>("GFX\\Level\\Assets\\AssetsSound\\Rocksmash2"); //hans sounds upupup = Content.Load <Song>("GFX\\Hans\\HansSounds\\up-up-up-the-ladder-we-go"); i_shouldpress = Content.Load <Song>("GFX\\Hans\\HansSounds\\i-should-press-it"); lets_pull = Content.Load <Song>("GFX\\Hans\\HansSounds\\lets-pull-this"); sfx = new SoundEffect[] { i_hope = Content.Load <SoundEffect>("GFX\\Hans\\HansSounds\\i_hope_we_find_our_home_soon"), wow_look = Content.Load <SoundEffect>("GFX\\Hans\\HansSounds\\wow-look-at-that-bird"), //assets sounds }; Gretatextures = new Texture2D[] { gretaWalk = Content.Load <Texture2D>("GFX\\Grietje\\Greta_Walk2.2"), gretaIdle = Content.Load <Texture2D>("GFX\\Grietje\\Greta_Idle2.2"), gretaSmash = Content.Load <Texture2D>("GFX\\Grietje\\Greta_Smash2.2"), gretaJump = Content.Load <Texture2D>("GFX\\Grietje\\Greta_Jump2.2"), }; Hanstextures = new Texture2D[] { hansIdle = Content.Load <Texture2D>("GFX\\Hans\\hansje_idle"), hansWalk = Content.Load <Texture2D>("GFX\\Hans\\hansje_walk"), hansJump = Content.Load <Texture2D>("GFX\\Hans\\hansje_jump"), }; bgtexture = Content.Load <Texture2D>("GFX\\Level\\BG"); button_tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\button2"); slaktex = Content.Load <Texture2D>("GFX\\Sheets\\slak_animatie"); door_tex = Content.Load <Texture2D>("GFX\\Level\\Assets\\deur_rood"); pressureplate = Content.Load <Texture2D>("GFX\\Level\\Assets\\knop"); liftobj = Content.Load <Texture2D>("GFX\\Level\\Assets\\blok_g_1"); hans = new Hans(Hanstextures[1], HansFrames, 1); hans.LoadContent(Content); grietje = new Grietje(Gretatextures[1], GretaFrames, 1); grietje.LoadContent(Content); cameraOne = new Camera(); defaultView = GraphicsDevice.Viewport; defaultView.Width = 1280; defaultView.Height = 720; manager = new LevelManager(Content); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.ApplyChanges(); //leftView = defaultView; //rightView = defaultView; //leftView.Width = leftView.Width / 2; //rightView.Width = rightView.Width / 2; //rightView.X = leftView.Width; // TODO: use this.Content to load your game content here }