Last active
December 24, 2015 14:43
-
-
Save takoeight0821/8bbe2d1a4fbe725aefda to your computer and use it in GitHub Desktop.
Siv3Dでダイバージェンスメーターのスケッチ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Siv3D.hpp> | |
double world_line = 0.0; | |
double readingSteiner() { | |
// 1%の確立で世界線が大きく変動する。 | |
if (RandomBool(0.01)) | |
{ | |
if (RandomBool(0.5)) // 減るか増えるかは半分半分 | |
{ | |
++world_line; | |
} else { | |
--world_line; | |
} | |
} | |
return world_line + Random(); | |
} | |
void drawDivergence(double divergence) | |
{ | |
/* | |
1. divergenceを文字列に変換 | |
2. ループで一文字ずつ対応した画像を描画 | |
3. 4秒間音鳴らしながらく1,2を繰り返す | |
が ん ば れ | |
*/ | |
} | |
void Main() | |
{ | |
const Font font(30); | |
drawDivergence(0.0); //基準世界線を表示 | |
while (System::Update()) { | |
// Sキーが押されるたびに世界線が変動する。 | |
if (Input::KeyS.clicked) | |
{ | |
drawDivergence(readingSteiner()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
多分動かない