//Write your own Update&Draw Action in here public static void EatApple() { Score += 10; speed += 0.1f; apple.Pos = new Point(StandAlone.Random(0, StandAlone.FullScreen.Width), StandAlone.Random(0, StandAlone.FullScreen.Height)); //화면의 랜덤한 위치로 애플이 옮겨갑니다. }
protected override void Update(GameTime gameTime) { if (GameExit) { Exit(); } Projectors.Update(); StandAlone.InternalUpdate(); CustomUpdate(); User.Update(); base.Update(gameTime); }
/// <summary> /// 리스트 아이템 중 한개를 랜덤하게 픽합니다. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="Ts"></param> /// <returns></returns> public static T RandomPick <T>(List <T> Ts) //리스트 아이템 중 한개를 랜덤하게 픽합니다. { double r = StandAlone.Random(); double m = 1.0 / Ts.Count; for (int i = 0; i < Ts.Count; i++) { if (r >= m * i && r < m * (i + 1)) { return(Ts[i]); } } return(Ts[0]); }
public CustomTLReader() : base() { this.Embracer = "[]"; this.AddRule("Script", (s) => { StandAlone.DrawString(s, new Point(100, 200), Color.White); }); }
public void Draw(Color c) { StandAlone.DrawString(FuncCallCount + " Loop,Time = " + StandAlone.ElapsedMillisec + "ms (per 1frame)", new Point(0, 0), c); }