コード例 #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]);
             }
         }
     }
 }