Exemple #1
0
 public Wall(Vector2f position) : base(position)
 {
     if (Sprite == null)
     {
         Sprite = new Sprite(new Texture(SeasonController.getInstance().getSeasonTexture()));
     }
     type = GameObjectType.Wall;
 }
Exemple #2
0
 public Wall()
 {
     if (Sprite == null)
     {
         Sprite = new Sprite(new Texture(SeasonController.getInstance().getSeasonTexture()));
     }
     type = GameObjectType.Wall;
 }
Exemple #3
0
 public static SeasonController getInstance()
 {
     if (instance == null)
     {
         instance = new SeasonController();
     }
     return(instance);
 }
Exemple #4
0
 protected void Init()
 {
     sc              = SeasonController.getInstance();
     TimeNow         = ClockObj.ElapsedTime.AsMilliseconds();
     TimeSeason      = ClockObj.ElapsedTime.AsMilliseconds();
     TimeRenderFrame = ClockObj.ElapsedTime.AsMilliseconds();
     FrameLast       = (int)TimeNow;
     WorldRender();
 }
Exemple #5
0
 protected void Update()
 {
     Physics();
     if (ClockObj.ElapsedTime.AsMilliseconds() - TimeSeason > 10000)
     {
         TimeSeason = ClockObj.ElapsedTime.AsMilliseconds();
         sc.nextSeason();
         for (int i = 0; i < 40; i++)
         {
             for (int j = 0; j < 40; j++)
             {
                 if (objects[i, j].type == GameObjectType.Wall)
                 {
                     objects[i, j].Sprite.Texture = new Texture(SeasonController.getInstance().getSeasonTexture());
                 }
                 //renderWindow.Draw(objects[i, j]);
             }
         }
     }
 }