Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created April 8, 2017 04:46
Show Gist options
  • Save triacontane/43724a7cdda285edbdf83ce70f4ec081 to your computer and use it in GitHub Desktop.
Save triacontane/43724a7cdda285edbdf83ce70f4ec081 to your computer and use it in GitHub Desktop.
三角関数でピクチャを動かすサンプル
◆注釈:浮遊
◆変数の操作:#0002 2:x = 100
◆変数の操作:#0003 3:y = 100 + Math.sin(Graphics.frameCount / 30) * 20;
◆ピクチャの表示:#1, icon, 左上 ({2:x},{3:y}), (100%,100%), 255, 通常
◆注釈:回転
◆変数の操作:#0002 2:x = 300 + Math.cos(Graphics.frameCount / 30) * 100;
◆変数の操作:#0003 3:y = 300 + Math.sin(Graphics.frameCount / 30) * 100;
◆ピクチャの表示:#2, icon, 左上 ({2:x},{3:y}), (100%,100%), 255, 通常
◆注釈:点滅
◆変数の操作:#0002 2:x = 100
◆変数の操作:#0003 3:y = 400
◆変数の操作:#0004 4:opacity = (1 + Math.sin(Graphics.frameCount / 30)) * 128;
◆ピクチャの表示:#3, icon, 左上 ({2:x},{3:y}), (100%,100%), 255, 通常
◆スクリプト:$gameScreen.picture(3)._opacity = $gameVariables.value(4);
◆注釈:伸縮
◆変数の操作:#0002 2:x = 600
◆変数の操作:#0003 3:y = 250
◆変数の操作:#0005 5:scaleX = (1.0 - Math.sin(Graphics.frameCount / 30) / 8) * 100;
◆変数の操作:#0006 6:scaleY = (1.0 + Math.sin(Graphics.frameCount / 30) / 8) * 100;
◆ピクチャの表示:#4, icon, 中央 ({2:x},{3:y}), (100%,100%), 255, 通常
◆スクリプト:$gameScreen.picture(4)._scaleX = $gameVariables.value(5);
:     :$gameScreen.picture(4)._scaleY = $gameVariables.value(6);
:     :$gameScreen.picture(4)._origin = 2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment