public TitleScene() { title = new SpriteObject(); title.pos = new Vector2(0,0); title.scale = Vector2.One; title.angle = 0.0f; title.alpha = 1.0f; }
public HandPointer() { // Instance of the data this.handPointer = new SpriteObject(); // Initializing the value this.pos = Vector2.Zero; this.offset = new Vector2(16, 16) * handPointer.scale; }
//----------------------------------------------------------------------// // 関数名 SelectEffect // // Function name SelectEffect // 機能 そのスプライトオブジェクトが選ばれているときのエフェクト // // Effect when the sprite object is selected function // 引数 スプライトオブジェクト // // Argument Sprite object // 戻り値 なし // // No return value //----------------------------------------------------------------------// public void SelectEffect(ref SpriteObject sprite) { // And adding the counter this.counter += 0.1f; // I shake the sprite object sprite.angle = (float)Math.Sin(this.counter) * 0.3f; // I expand the sprite object //sprite.scale = new Vector2(2.4f, 2.4f); sprite.scale = new Vector2(1.4f, 1.4f); }
//--------------------------------------// // 関数名 NonEffect // // Function name NonEffect // 機能 エフェクトをかけない // // Do not apply effect function // 引数 スプライトオブジェクト // // Argument Sprite object // 戻り値 なし // // No return value //--------------------------------------// public void NonEffect(ref SpriteObject sprite) { // The return on the basis of the angle sprite.angle = 0.0f; // I returned to the original scale //sprite.scale = new Vector2(2.0f, 2.0f); sprite.scale = new Vector2(1.0f, 1.0f); }
public ResultMenu() { // screen size this.w = Game1.graphics.GraphicsDevice.Viewport.Width; this.h = Game1.graphics.GraphicsDevice.Viewport.Height; // complete game this.Victory = false; // background this.bg_alpha = 0.0f; this.dark_alpha = 0.0f; // animation this.animate_start = false; this.drawall = false; this.showtext = false; // score this.yourscore_posx = w * 0.25f; this.yourscore_scale = 1.0f; this.score_posx = w * 0.5f; this.score_posy = h * 0.5f; this.score_sizex = 70; this.score_sizey = 70; this.score_scale = 2.0f; // gameover text this.gameover_text_y = h * 0.5f; this.gameover_text_alpha = 0.5f; // victory text this.victory_text_y = h * 0.75f; this.victory_text_alpha = 0.5f; // Configured without a command that is selected this.currentCommand = new NoneCommand(); // Initialization of the hand pointer this.handPointer = new HandPointer(); // Instantiation of each command this.replay = new SpriteObject(); this.exit = new SpriteObject(); // Adjustment of the position of each command //this.replay.pos = new Vector2(w * 0.5f, h * 0.32f); this.replay.pos = new Vector2(w * 0.5f, h * 0.75f); this.exit.pos = new Vector2(w * 0.5f, h * 0.625f); // Initialize the counter this.counter = 0.0f; }
//----------------------------------------------------------// // 関数名 VanishCountDown // // Function name VanishCountDown // 機能 カウントダウンの文字がだんだんと消えていく // // Function of character countdown fades away gradually // 引数 カウントダウンのスプライトオブジェクト // // Sprite object of argument countdown // 戻り値 なし // // No return value //----------------------------------------------------------// private void VanishCountDown(SpriteObject num) { // Set the alpha num.alpha -= 1.0f / 60.0f; // Set the scale num.scale -= new Vector2(2.0f / 60.0f, 2.0f / 60.0f); // Set the angle num.angle += 0.1f; }
//------------------------------------------// // 関数名 InitCountDown // // Function name InitCountDown // 機能 カウントダウン変数の初期化 // // Initialization function countdown variable // 戻り値 なし // // No return value // 引数 なし // // No argument //------------------------------------------// private void InitCountDown() { // Initialization of the countdown for sprite for (int i = 0; i < countdownNum.Length; i++) { // Initialization countdownNum[i] = new SpriteObject(); // Position is the middle of the screen countdownNum[i].pos = new Vector2(Game1.graphics.GraphicsDevice.Viewport.Width * 0.5f, Game1.graphics.GraphicsDevice.Viewport.Height * 0.5f); // Scale countdownNum[i].scale = Vector2.One * 3.0f; } // Initialization of the characters in the Go go = new SpriteObject(); // The middle of the screen go.pos = new Vector2(Game1.graphics.GraphicsDevice.Viewport.Width * 0.5f, Game1.graphics.GraphicsDevice.Viewport.Height * 0.5f); // スケール go.scale = Vector2.One * 3.0f; }