diff --git a/.bin/songs/Cranky-VLSI_short.ogg b/.bin/songs/Cranky-VLSI_short.ogg new file mode 100644 index 0000000..9f1c26e Binary files /dev/null and b/.bin/songs/Cranky-VLSI_short.ogg differ diff --git a/.bin/songs/Cranky-VLSI_short.sj b/.bin/songs/Cranky-VLSI_short.sj new file mode 100644 index 0000000..e69de29 diff --git a/.bin/songs/README.md b/.bin/songs/README.md new file mode 100644 index 0000000..34d0b74 --- /dev/null +++ b/.bin/songs/README.md @@ -0,0 +1,4 @@ +SONGS +==== + + - [Cranky-VLSI_short](https://soundcloud.com/felinegroove/vlsi-short-edit) diff --git a/.bin/songs/list.json b/.bin/songs/list.json index 00ac09b..e83f09f 100644 --- a/.bin/songs/list.json +++ b/.bin/songs/list.json @@ -10,5 +10,17 @@ "bg-inner-color": [0.8, 0.8, 0.8, 1], "bg-outer-color": [0.1, 0.1, 0.1, 1] } + }, + { + "name": "Cranky - V.L.S.I.", + "bpm": 60, + "music": "Cranky-VLSI_short.ogg", + "script": "Cranky-VLSI_short.sj", + + "preview": { + "play-offset": 38000, + "bg-inner-color": [0.6, 0.6, 0.7, 1], + "bg-outer-color": [0.1, 0.1, 0.1, 1] + } } ] diff --git a/src/sj/SelectScene.d b/src/sj/SelectScene.d index edd7311..df6ec10 100644 --- a/src/sj/SelectScene.d +++ b/src/sj/SelectScene.d @@ -219,7 +219,7 @@ private class SongAppearState : AbstractSceneState { const song = owner.songs_[song_index_]; with (owner.text_) { - const w = LoadGlyphs(vec2i(256, 64), + const w = LoadGlyphs(vec2i(1024, 64), song.name.to!dstring, vec2i(TitleTextSize, 0), owner.fonts_.gothic); matrix.scale = TitleTextScale; matrix.translation = TitleTextTranslation + vec3(-w/2*matrix.scale.x, 0, 0); @@ -306,16 +306,21 @@ private class SongWaitState : AbstractSceneState { } } - if (input.right) { - song.StopPlaying(); - song_appear_state_.Initialize(++song_index_%owner.songs_.length); - return CreateResult(song_appear_state_); - } if (input.up) { song.StopPlaying(); owner.title_scene_.Initialize(); return CreateResult(owner.title_scene_); } + if (input.left && song_index_ != 0) { + song.StopPlaying(); + song_appear_state_.Initialize(song_index_-1); + return CreateResult(song_appear_state_); + } + if (input.right && song_index_+1 < owner.songs_.length) { + song.StopPlaying(); + song_appear_state_.Initialize(song_index_+1); + return CreateResult(song_appear_state_); + } ++frame_; return CreateResult(this); diff --git a/src/sj/Text.d b/src/sj/Text.d index ff200de..d9b33f3 100644 --- a/src/sj/Text.d +++ b/src/sj/Text.d @@ -47,6 +47,8 @@ class Text { model_width_ = 0; int bmp_width; foreach (c; text) { + if (c == ' ') continue; + with (gloader) { character = c; Load(face).enforce; diff --git a/src/sj/TextProgram.d b/src/sj/TextProgram.d index 5b02453..5fcdc99 100644 --- a/src/sj/TextProgram.d +++ b/src/sj/TextProgram.d @@ -62,12 +62,14 @@ class TextProgram { float vx = vert_.x / model_width; vec2 uv = uv_; + uv.y = choose(3, frame%4, uv.y, + choose(0, vx, 0.25, clamp(uv.y, 0, 0.4), uv.y)); uv.y = choose(15, frame%18, uv.y, - choose(0.1, vx, 0.2, clamp(uv.y, 0, 0.6), uv.y)); + choose(0.1, vx, 0.2, clamp(uv.y, 0.6, 1), uv.y)); uv.y = choose(8, frame%14, uv.y, choose(0.1, vx, 0.6, clamp(uv.y, 0, 0.8), uv.y)); uv.y = choose(21, frame%29, uv.y, - choose(0.2, vx, 0.3, clamp(uv.y, 0.1, 1), uv.y)); + choose(0.2, vx, 0.3, clamp(uv.y, 0.3, 1), uv.y)); uv.y = choose(20, frame%23, uv.y, choose(0.4, vx, 0.6, clamp(uv.y, 0.4, 1), uv.y)); uv.y = choose(5, frame%6, uv.y,