make the main menu logo pulse

This commit is contained in:
yugecin 2016-12-18 23:41:36 +01:00
parent 13e1fb5193
commit f7e42c271f
2 changed files with 14 additions and 2 deletions

View File

@ -256,7 +256,18 @@ public class MainMenu extends BasicGameState {
playButton.draw(); playButton.draw();
exitButton.draw(); exitButton.draw();
} }
logo.draw();
// logo
Float position = MusicController.getBeatProgress();
if (position == null) {
position = System.currentTimeMillis() % 1000 / 1000f;
}
float scale = 1f - (0f - position) * 0.05f;
logo.draw(Color.white, scale);
Image ghostLogo = GameImage.MENU_LOGO.getImage().getScaledCopy(logo.getCurrentScale() / scale * 1.05f);
float scaleposmodx = ghostLogo.getWidth() / 2;
float scaleposmody = ghostLogo.getHeight() / 2;
ghostLogo.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody, Colors.GHOST_LOGO);
// draw music buttons // draw music buttons
if (MusicController.isPlaying()) if (MusicController.isPlaying())

View File

@ -45,7 +45,8 @@ public class Colors {
BLUE_SCOREBOARD = new Color(133, 208, 212), BLUE_SCOREBOARD = new Color(133, 208, 212),
BLACK_BG_NORMAL = new Color(0, 0, 0, 0.25f), BLACK_BG_NORMAL = new Color(0, 0, 0, 0.25f),
BLACK_BG_HOVER = new Color(0, 0, 0, 0.5f), BLACK_BG_HOVER = new Color(0, 0, 0, 0.5f),
BLACK_BG_FOCUS = new Color(0, 0, 0, 0.75f); BLACK_BG_FOCUS = new Color(0, 0, 0, 0.75f),
GHOST_LOGO = new Color(1.0f, 1.0f, 1.0f, 0.25f);
// This class should not be instantiated. // This class should not be instantiated.
private Colors() {} private Colors() {}