示例#1
0
 public Wall(Vector2f position) : base(position)
 {
     if (Sprite == null)
     {
         Sprite = new Sprite(new Texture(SeasonController.getInstance().getSeasonTexture()));
     }
     type = GameObjectType.Wall;
 }
示例#2
0
 public Wall()
 {
     if (Sprite == null)
     {
         Sprite = new Sprite(new Texture(SeasonController.getInstance().getSeasonTexture()));
     }
     type = GameObjectType.Wall;
 }
示例#3
0
 public static SeasonController getInstance()
 {
     if (instance == null)
     {
         instance = new SeasonController();
     }
     return(instance);
 }
示例#4
0
文件: Game.cs 项目: tohaosipow/c-game
 protected void Init()
 {
     sc              = SeasonController.getInstance();
     TimeNow         = ClockObj.ElapsedTime.AsMilliseconds();
     TimeSeason      = ClockObj.ElapsedTime.AsMilliseconds();
     TimeRenderFrame = ClockObj.ElapsedTime.AsMilliseconds();
     FrameLast       = (int)TimeNow;
     WorldRender();
 }
示例#5
0
文件: Game.cs 项目: tohaosipow/c-game
 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]);
             }
         }
     }
 }