Commit Graph

48 Commits

Author SHA1 Message Date
Jeffrey Han
3b13cc794b Implemented volume-bg and master volume setting.
- All sounds are now multiplied by a master volume setting.
- Changed all default volume levels.
- Scrolling in the main menu and game states changes the master volume and displays a volume bar on the right side of the screen.
- "volume-bg.png" image by @kouyang.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-20 14:52:02 -05:00
Jeffrey Han
95775d8e73 Preload game images when program initializes.
Reverted earlier change to load images immediately before a game begins, since there is a noticeable lag in some cases.

Other changes:
- Added 'preload' field to GameImage.
- Changed 'gameImage' field in GameImage to 'skinnable' (more suitable name).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-18 17:01:13 -05:00
Jeffrey Han
2f56bca9f7 Small GUI tweaks.
- FPS display is now much more subtle.
- A couple of main menu tweaks.

Other changes:
- Restore old alpha levels of Utils.COLOR_* constants when modifying them.
- Utils.loadFont() can load any font effect, not just a ColorEffect.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-18 12:39:30 -05:00
Jeffrey Han
31a97fbc5d Minor graphical updates and code cleaning.
- Padded game score display, and always display 2 digits in front of the decimal (e.g. 00.00% instead of 0.00%).
- Keep map progress circle at a fixed location instead of basing it off the score length.
- Moved some track resets (pause + restart at preview) to trigger upon loading the song menu.  Fixes weird behaviors when leaving the game state.
- Cleaned up trailing whitespace and added missing overrides.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 15:44:13 -05:00
Jeffrey Han
816c9bb659 Quick bug fixes.
- Checkpoint loading now works again. (blame: 9e69afa)
- Forgot to check for VSync when application initializes. (blame: 97f3aad)
- Also clear game data after finishing a checkpoint game.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 14:10:42 -05:00
Jeffrey Han
b54eb95747 Updated copyright notices for 2015.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 12:05:44 -05:00
Jeffrey Han
7bd9eba2f5 Added HitObject interface for OsuHitObjects during gameplay.
This greatly simplifies object-handling code, and is slightly more time and memory efficient.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 03:47:37 -05:00
Jeffrey Han
38b3621c29 Implemented Ctrl+Enter in song menu (play with "auto" mod).
Also made 'Esc' during gameplay return to the song menu immediately if the "auto" mod is active.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 02:00:42 -05:00
Jeffrey Han
553f091693 Added ErrorHandler class to handle all critical errors.
This mostly replaces the Slick2D Log class for error reporting.  Most game errors will now trigger the error popup.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-15 21:55:26 -05:00
Jeffrey Han
516e6280c7 Call System.gc() on track changes and game resets.
This causes a noticeable drop in memory usage in most cases.

Also renamed the "crash" popup since the game doesn't necessarily crash.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-15 16:47:55 -05:00
Jeffrey Han
b856e2924c Minor updates and code improvements.
- MusicController.getPosition() now returns time even when track is paused. (e.g. song progress bar in main menu won't reset when paused)
- Force unpause track when entering the song menu.
- Rewrote Game.RESTART_* constants as enums.
- Cleaned up logo play/exit button scaling.
- MainMenu.previous is now non-static.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-15 00:56:30 -05:00
Jeffrey Han
03095733df Removed static fields in Game state.
Mostly merged from #8 (72e8a7e).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-14 23:57:50 -05:00
Jeffrey Han
64d961a8f9 Only load image resources when needed.
- Stop loading all images on startup.
- Game images are preloaded before the song starts.
- Destroy skin images immediately after finishing a beatmap, potentially saving lots of memory.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-14 23:10:19 -05:00
Jeffrey Han
05a671e627 Quick fix for countdown displays. (blame: 9e69afa)
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-14 22:31:48 -05:00
Jeffrey Han
f6eac71643 Moved most Image creation into GameImage enum.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-07 23:45:21 -05:00
Jeffrey Han
8671718ce3 Moved most GameImage scaling/processing to a single file.
- To scale an image, override process_sub() in its enum definition.  All GameImages call the process() method when loaded.
- Skin GameImage overrides will now call process() immediately, so there's no more need for the hackish scaling status.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-07 22:36:39 -05:00
Jeffrey Han
1e806bc9c6 SoundController refactoring.
- Added enum classes SoundEffect and HitSound.
- Added a SoundComponent interface for sound effects and hit sounds, and extended playSound() and playHitSound() methods to play any SoundComponent.
- Moved features related to sample sets to the HitSound class, and rewrote sample sets as an internal enum class.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-07 19:29:51 -05:00
Jeffrey Han
3127571886 Smoother health bar changes.
Also merged GameScore update calls into a single method.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-30 01:17:05 -05:00
Jeffrey Han
2592faec44 Renamed GUIMenuButton class to MenuButton.
The class was originally named with the intent of adding many other GUI classes, but this never happened.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-30 00:00:58 -05:00
Jeffrey Han
9e69afac91 Added retry counter.
Display number of retries (after retrying at least twice).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-29 23:35:31 -05:00
Jeffrey Han
cc84d4a3e4 Subtle fade in effect for circles and sliders. (#9)
Also resize the "skip" button on hover. (follow-up 33f5df0)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-24 02:45:43 -05:00
Jeffrey Han
068a844e1f Fixed music player issues with handling repeat tracks.
When pressing the "next" button, songs will only be pushed when a new track plays.  Fixes a potential null pointer crash.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-24 00:25:26 -05:00
Jeffrey Han
9d3a12ad9c Display checkpoint time on game screen after loading.
Also fixed some indentation issues.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-20 15:30:20 -05:00
Jeffrey Han
83e486054f Catch (nearly) all exceptions thrown by OsuParser.
- Properly handle bad input and log a warning.  The game may run with some gameplay errors (ex. if no base TimingPoint is parsed), but it should not crash.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-24 13:38:59 -04:00
Jeffrey Han
717605564d Hit object refactoring.
- Moved the bulk of hit object parsing into the OsuHitObject constructor, and made all fields private.  Only combo-related data is still set by OsuParser.
- Added 'isCircle()', 'isSlider()', 'isSpinner()', and 'isNewCombo()' methods for convenience.

Other changes:
- Fixed difficulty overrides are no longer affected by game mods.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-18 15:11:57 -04:00
Jeffrey Han
edf40e11fd Added configurable game key bindings.
- Game keys (default Z/X) can be changed to any letter or digit in the options screen.

Other changes:
- Mouse/keyboard input in the "Game Paused Menu" state is now the same as in the game state (i.e. all game keys available).
- Moved 'isInputKeyPressed()' into "Utils" class ("Game" state didn't even call it).
- Trimmed 'failsound.wav'.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-17 23:58:37 -04:00
Jeffrey Han
b0c0b44ef1 Major track length-related updates.
- Parse and store the end time for every beatmap (i.e. end time of last hit object).
- Added a 'length' sorting tab.
- Added 'length' search condition.
- Removed 'getTrackLength()' and 'getTrackLengthString()' methods, as they are no longer needed.
- Added a loader spritesheet animation to render during MP3 conversions (in place of track length rendering upon completion).

Other changes:
- Added a yellow progress circle during lead-in time.
- Fixed sorting tab positioning.
- Slightly increased button animation speed in "Main Menu Exit" state.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-17 21:16:15 -04:00
Jeffrey Han
cb396e0d20 Added "Easy" mod.
- Halves all difficulty values and grants 3 "lives" instead of 1, with a score multiplier of 0.5x.

Other changes:
- Fixed score display in game state if score exceeds 8 digits.
- Added a "HP_DRAIN_MULTIPLIER" constant for steady HP drain/increase (to replace numeric constants).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-16 16:56:23 -04:00
Jeffrey Han
7a187c4e4f Game mod refactoring.
- Created "GameMod" enum to handle all mod-related actions and store all related data.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-16 16:01:36 -04:00
Jeffrey Han
5a1972a2bd Some code cleanup.
- Overhauled OsuTimingPoint class: parsing is done in the constructor, and fields are no longer public.
- Improved consistency of static/non-static fields in a couple of classes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-09 13:36:42 -04:00
Jeffrey Han
50fb71e353 Implemented saving/loading from checkpoints.
- A checkpoint (track position) can be set in the options screen, and also while playing by pressing "CTRL+S".
- A checkpoint can be loaded by pressing "CTRL+L" while playing.  This will reset all game data and begin from the checkpoint time; the ranking screen will be skipped upon song completion.

Other changes:
- Don't draw grade if no objects have been processed (previously defaulted to GRADE_D).
- Calculate slider start/end angles based on a step difference (previously an arbitrary 0.01 difference).
- Always end a slider curve base on the last control point.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-08 22:17:48 -04:00
Jeffrey Han
2ed8e66bbf Minor search feature fixes.
- Search textfield now properly retains focus in song selection menu.
- Clearing an invalid search no longer changes the current song.

Other changes:
- Fixed skip image not being resized correctly.
- Added menuclick sounds when selecting a new song.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-08 19:03:43 -04:00
Jeffrey Han
331f374a5b Better positioning of mod icons and song menu header text.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-08 13:38:16 -04:00
Jeffrey Han
a9cc7a3deb Scale and rotate the cursor.
- Cursor is now scaled based on window size.
- Cursor now rotates slowly (new style only).
- Cursor now expands upon mouse press.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-06 23:13:33 -04:00
Jeffrey Han
0dbfd18c5f Added a few missing keyboard shortcuts.
- Main Menu: "P" (play), "Q" (quit)
- Game: Ctrl + "R" (restart)

Other changes:
- Song Menu search textfield no longer retains focus in different states.
2014-07-05 14:29:48 -04:00
Jeffrey Han
83f13a8879 Added options for global fixed difficulty settings (CS, HP, AR, OD).
- Added a new tab in Game Options screen containing the values.

Other changes:
- Corrected "Hard Rock" difficulty modifiers.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-05 01:24:01 -04:00
Jeffrey Han
06f8dae037 Reduced unnecessary reloading of default images. (follow-up 16afcaf)
- GameImage now stores both a default image and skin image, returning the skin image whenever available.
- Default images are loaded once on startup, instead of before every game.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-04 19:59:57 -04:00
Jeffrey Han
16afcaf3e6 Added initial support for loading beatmap skins.
- Added a GameImage enum for more organized loading of image resources.
- Game image loading now takes place directly before each beatmap is loaded.
- Added option 'IGNORE_BEATMAP_SKINS' to disable this feature.

Other changes:
- Slight correction in readme file: apparently the JAR will not run in the osu! program folder.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-04 16:41:52 -04:00
Jeffrey Han
0b471fa1cc Animated the score display.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-03 02:03:56 -04:00
Jeffrey Han
f195ffb861 Added support for default playfield image and an override option.
- Credits: https://osu.ppy.sh/forum/t/198483 (image by Xiaounlimited)

Other changes:
- Added "Unranked" text image, currently displayed for "Auto" mod plays only (image by XinCrin).
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-03 01:05:23 -04:00
Jeffrey Han
03be29307f Misc. bug fixes and improvements.
- Fixed Game not loading OsuFile for maps in a song group. (blame: 5612336)
- Implemented rotations for reverse arrows, and added a new one by Alic1a.
- "Auto" mod: pausing no longer requires click to unpause, and mod images are permanently drawn.
- Program now loads from Main Menu instead of Options (unnecessary complications for the sake of a transition).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-02 23:38:30 -04:00
Jeffrey Han
2c2f28b441 Game options overhaul & new options.
- Separated options into "Display", "Music", and "Gameplay" tabs.
- New options: VolumeHitSound, DimLevel, PerfectHit
- Added options that were previously missing from Game Options screen.
- Added sounds to Game Options screen.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-02 18:24:19 -04:00
Jeffrey Han
56123363b3 Implemented dynamic main menu backgrounds.
- This can be switched off in the configuration file.
- Credits: https://osu.ppy.sh/forum/t/98954

Other changes:
- Removed OsuFile setters/getters from Game state, replaced with a 'getOsuFile()' method in MusicController (a more logical location).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-02 03:02:11 -04:00
Jeffrey Han
bcd0c23961 Added initial support for loading user skins.
- "Skins" directory is created in the root folder, and reads files directly from there (for now).  NOT ALL FILES ARE SUPPORTED.
- To change the path (e.g. to an installed skin), edit the path in the configuration file.

Other changes:
- Renamed some files: directories now begin with a capital letter (to match osu! naming), and '.osu_tmp' renamed to '.opsu_tmp'.
- Disabled mouse grabbing, as this does not seem to work properly for touchscreen devices. (partial revert of ab487c5)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-02 01:53:42 -04:00
Jeffrey Han
ab487c5e80 Replaced native cursors with skinnable ones.
- Added support for both the new (2013+) and old cursor styles.  These can be toggled on/off in the configuration file.
- Added cursor images by XinCrin (old style) and teinecthel (new style).

Other changes:
- Refactoring: Created a "Utils" module, containing methods and constants that didn't belong in the "Options" state and some duplicated drawing methods.
- Mouse is now grabbed during gameplay.
- Removed 'optionsChanged' switch, simplifying adding new options.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-01 19:32:03 -04:00
Jeffrey Han
0604a25822 Added initial sound effect support.
- Added SoundController module, which uses Java Sound since OpenAL has a slight delay on playing sounds.
- Uploaded all effect WAVs. (credits: WWWskin, AL's IA, Fantasy's Skin, Minimalist Miku)
- Added a missing entry in credits.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-01 01:14:03 -04:00
Jeffrey Han
6bdb026447 Added support for floating-point difficulty values (v13).
Thanks to Marcin for the info and FieryLight for the report.
2014-06-30 04:03:39 -04:00
Jeffrey Han
9da166f60f Initial commit. 2014-06-29 22:17:04 -04:00