public Campfire(int x, int y) : base(x, y, 10) { Size = 25; RenderMode = RenderContextMode.ObjectFirst; image = Utilities.GetResourceImage("campfirelit.png"); RenderContext.AddAccessory(new Halo(13, 13, 200)); FleeFromThisUtility = new ActionUtility(new FleeAction(this), new Tuple <Need, double>[] { ActionUtility.NewPair(Need.JobFullfilment, 0.0025) }); }
private static double updateDelta = frameRate / updateRate; // Increment by this amount each tick to get updateRate per second. public Form1() { InitializeComponent(); displayPanels = new List <DisplayPanel>(); Utilities.ResourceDirectory = @"..\..\ResourceImages\"; Utilities.DefaultImage = new Bitmap(Utilities.ResourceDirectory + "default.png"); // Set Size of the display area. Utilities.ViewWidth = myPanel.Width; Utilities.ViewHeight = myPanel.Height; exitImage = Utilities.GetResourceImage("close.png"); myPanel.Paint += GamePanel_Paint; #region GameTime gameTime = new GameTime(15); // Setup the game time object to cycle day to night in <n> minutes. gameTime.DayNightToggle += OnDayNightToggle; SetDayNightBox(); // Set day/night image. startTime = DateTime.Now; timeLabel.Text = gameTime.ToString(); #endregion worldController = new WorldController(gameTime.Copy(), 2 * myPanel.Width, 2 * myPanel.Height); worldController.PlayerDied += WorldController_PlayerDied; RenderTimer = new Timer() { Interval = (int)Math.Ceiling(1000.0 / frameRate) }; RenderTimer.Tick += Timer_Tick; RenderTimer.Start(); KeyPreview = true; KeyDown += Form1_KeyDown; KeyUp += Form1_KeyUp; Resize += Form1_Resize; myPanel.MouseClick += MyPanel_MouseClick; myPanel.MouseMove += MyPanel_MouseMove; }
public Halo(double x, double y, int size) : base(x, y, size) { image = Utilities.GetResourceImage("radialgradient.png"); }