Commit Graph

144 Commits

Author SHA1 Message Date
Jeffrey Han
356772b6b6 Minor replay changes, and added pop effect for the scorebar marker.
- When reading replay frames, the thread will now sleep for the time difference minus 1ms if possible (to avoid so much unnecessary looping).
- Fixed a bug where the 'replay' GameData field wasn't being set in some cases.
- Move cursor to skip button location when skipping intro in a replay.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-13 18:03:44 -04:00
Jeffrey Han
a19eb39259 Fixed bugs with Hard Rock mod and replays during breaks.
- Hard Rock now flips hit object coordinates along the x axis, as in osu!.
- Fixed a bug where replay data wasn't being shown during breaks.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-12 20:33:32 -04:00
Jeffrey Han
49c85b3b08 Store raw hit object coordinates instead of scaled ones.
Fixes a bug where a resolution change (by restarting through the app) wouldn't re-scale hit object coordinates.  Scaled coordinates are now stored in HitObject fields.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-12 20:12:43 -04:00
Jeffrey Han
87323533af Better error handling for Replay.load().
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-12 01:18:50 -04:00
Jeffrey Han
712cf30e01 Added replay saving/loading and score database auto-updater.
- Added 'info' table to score database to store the database version.  Upon startup, if the stored version is less than the source version, all update queries defined in ScoreDB.getUpdateQueries() will be run.
- Created "Replays" directory to store replay files.  Replay files are created after gameplay.
- Added 'replay' column to the score database to hold replay file names.
- Created a Game.loadOsuFile() method to load game data.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-11 20:52:51 -04:00
Jeffrey Han
37c0763f32 Allow showing a replay after a game.
Added a pause-replay image by XinCrin, and deleted ranking-retry/ranking-exit images.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-11 15:53:19 -04:00
Jeffrey Han
790a66ec1e Initial replay recording support.
- Added listener and events in Game state to record replay frames.
- Send more accurate keys.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-10 22:37:23 -04:00
Jeffrey Han
7536056a59 Initial replay writing support.
- Added Replay.save() method to save replays to a file.
- Separated Replay loading from the constructor into a load() method.
- Added OsuWriter class to write replays.
- Parse replay seeds (what do they do?).
- Added Updater.getBuildDate() method to retrieve the current build date (for the replay 'version' field).
- Added osu! mode constants in OsuFile.
- Added methods to retrieve raw ReplayFrame coordinates.
- Added replay fields/methods to GameData and Game state.
- Added jponge/lzma-java dependency for LZMA compression, since it isn't implemented in Apache commons-compress...

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-10 18:10:51 -04:00
Jeffrey Han
3da7b320f0 Follow-up to 1f8c150: fixed an error with checkpoint loading.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-10 01:29:08 -04:00
Jeffrey Han
1f8c150e6c Update replay frames in a new thread.
This drops less frames, but is still pretty bad.  See #42.
- Changed some LinkedList classes to LinkedBlockingDeques and added some synchronized methods.
- Slight modifications to OpenALStreamPlayer (may or may not be slightly more accurate).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-10 00:48:04 -04:00
Jeffrey Han
fa6132808e Show the default mouse cursor during replays.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-09 19:54:28 -04:00
Jeffrey Han
f6412f06e8 Initial replay parsing support.
- Basic implementation of viewing replays in the Game state.
- Added OsuReader class for reading certain osu! file types. (author: Markus Jarderot)
- Added Replay, ReplayFrame, and LifeFrame classes to capture replay data. (author: smoogipooo)
- Added 'keyPressed' parameter to HitObject.update().
- Added cursor-drawing methods in UI that take the mouse coordinates and pressed state as parameters.
- Added GameMod methods to retrieve/load the active mods state as a bitmask.
- Added Apache commons-compress dependency for handling LZMA decompression.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-09 18:32:43 -04:00
Jeffrey Han
4718cb9aa5 Follow-up to #37.
- Removed 'currentObject' parameter from HitObject.draw() since it's no longer used.
- Changed "spun out" rpm.
- Formatting changes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 15:38:59 -05:00
Jeffrey Han
6cd6938ea5 Preload game images directly before a game. (undo 95775d8)
Not noticing any bad effects from this anymore.  The application should load faster again.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-06 14:39:49 -05:00
Jeffrey Han
0a1b10fbdb Implemented "relax" mod.
Also added a few checks for related "autopilot" mod (probably incomplete).

Fixed the wrong default background being shown in the ranking screen.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-06 00:25:48 -05:00
Jeffrey Han
cf9b22442f Added global F7 and F10 shortcuts.
- F7: cycles through FPS settings.
- F10: toggles mouse enable/disable state during gameplay.

Also added bar notifications for saving/loading checkpoints.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-05 14:40:57 -05:00
Jeffrey Han
235adc539e Extracted UI components from Utils into a separate UI class.
Added draw(), update(), and enter() methods in UI to do all the necessary calls (instead of letting the states handle them).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-05 13:27:45 -05:00
Jeffrey Han
bf04083ebd Added a beatmap cache database.
- New database ".opsu.db" stores a cached copy of all parsed beatmaps.  All data will be read from this database unless the last modified time of a beatmap file does not match the one in the table.
- OsuParser inserts all new entries to the database in batch after parsing.
- Added *toString()/*fromString() methods for 'breaks', 'timingPoints', and 'combo' fields in OsuFile for use with the database.
- For any database format changes, update the DATABASE_VERSION field in OsuDB.
- Reloading beatmaps (F5) will now clear the beatmap cache.

Related changes:
- Added small DBController class for convenience.
- Changed 'bg' field of OsuFile to only contain the image file name, instead of the full path.
- Deleted printDatabase() method from ScoreDB.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-04 21:03:06 -05:00
Jeffrey Han
de949ef11c Added options to disable the mouse wheel or mouse buttons during gameplay.
- Clicking the mouse wheel now pauses the game (with these options disabled).
- Created an "Input" category in the options menu.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-02 22:12:57 -05:00
fd
04bfbc70fc Addition/Edge Addition SampleSet
Minor fix with combo colors and spinners
2015-03-01 11:06:46 -05:00
Jeffrey Han
25a7a826f1 More graphical updates, some code cleanup, and minor fixes.
- The MenuButton class now fully supports hover effects (scale, fade, rotate) for Animations.
- Used a fixed location for the selection buttons in the song menu (previously based on the "back" button width, which varies widely in different skins).
- Added hover effects for "retry" and "exit" buttons in the ranking screen.
- Changed animation speed of back/skip buttons.
- Fixed a bug where main menu showed the incorrect number of songs loaded during searches.
- Removed unneeded draw() methods in Utils for color filters (since 69f5aa5).
- Moved Utils.drawCentered(Image, ...) into the Image class.
- Added overwritten Image class to Maven excludes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-19 00:33:32 -05:00
Jeffrey Han
1a4120a736 Follow-ups to #21.
- Reverted "Extends ScoresData bg to clock", as this was intended behavior.
- Fixed overlapping text in the options menu, and made it look more similar to the other menus.
- Fixed issues with the text and icon in the song menu header in certain resolutions.
- Fixed minor issue with ranking screen header text positioning.
- Decreased skip button hover scale.
- Some code style changes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-18 19:35:26 -05:00
fd
65e538fbdc Merge remote-tracking branch 'orgin/master' into omaster
Conflicts:
	src/itdelatrisu/opsu/GameImage.java
	src/itdelatrisu/opsu/OsuGroupNode.java
2015-02-17 22:49:19 -05:00
fd
ffed4b260a Back and Skip animation
removed minimum time before skip button is shown.
2015-02-17 22:29:53 -05:00
Jeffrey Han
329d54c230 Minor changes.
- Replaced duplicate GameImage.process_sub() calls from related images with calling a single method, for easier editing.
- Suppress warnings from overwritten Slick2D classes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-16 01:24:22 -05:00
fd
5a2fbd82fa Removed Hit Error Bar during breaks
Keep Hit Error Ticks inside bar
Removed Miss Locations
2015-02-14 22:15:41 -05:00
fd
597c4bfb19 Visual Changes
mostly personal preferences though

Larger hit circles
Circle overlay after drawing circle
Fade in approach circles
Fade in sliders (I don't think it looks that bad)
Fade out hit lighting
Hit Error Bar
 Probably need an option for this.
Miss locations(I don't know)

Reverse Slider ball rotation on repeats
2015-02-14 13:45:14 -05:00
Jeffrey Han
54806303f4 Reformatting of #17 and #18, and minor bug fix in #17.
Fixed not losing any health at near-zero rotation angles.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-14 01:07:17 -05:00
Jeffrey Han
7cc4ff51d0 Follow-up to c6791c4.
- Added score management menu for deleting individual scores.
- Store generated title string lists in the beatmap menus to prevent performance issues.

Allow using the right mouse button (as well as left mouse button) in all states.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-13 03:45:38 -05:00
Jeffrey Han
f6eec5cd6c Follow-up to #15.
- Removed the temporary directory (Options.TMP_DIR), which is no longer needed.
- Excluded original Slick2D classes that were overridden in pom.xml.
- Formatting changes and documentation.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-12 03:52:19 -05:00
Jeffrey Han
800014ed4c Merge pull request #15 from fluddokt/omaster
MP3 Audio Streaming through modifying some of slick's openal files
2015-02-12 02:47:32 -05:00
Jeffrey Han
99bc944ed6 Minor updates.
- Draw the playfield background in the song menu if a background cannot be drawn for the focused beatmap.
- Added ScoreDB.deleteScore() method to delete a score from the database.
- Added @author tags for curve-related classes (by fluddokt, #12).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-11 02:56:02 -05:00
Jeffrey Han
f56c02864b Updates and fixes from fluddokt/opsu@76778f8 and fluddokt/opsu@cf321e9.
- Rotate slider ball image along the curve.
- Show download speed and time remaining when hovering over the download info button.
- Maintain aspect ratio of beatmap background image during gameplay.
- Clear beatmap background image cache after reaching OsuFile.MAX_CACHE_SIZE.
- Multiply hit circle size by OsuHitObject.getXMultiplier().
- Scale MENU_BUTTON_BG based on SongMenu.MAX_SONG_BUTTONS.
- Fixed download search TextField retaining focus even after leaving the downloads menu.
- Include Unicode title/artist strings in searches.
- Parse x,y beatmap coordinates as floats (instead of integers), and only read Kiai time if present.
- Added 1600x1200 resolution.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-09 21:40:38 -05:00
fd
6883e2ab44 MP3 Audio Streaming through modifying some of slick's openal files
May rarly crash/not play on next music.
May have introduced other unknown bugs. 
This may be due to loading it async.
Also loading of ogg is not loaded async anymore as it seems it doesn't
work very well.
2015-02-08 23:48:55 -05:00
Jeffrey Han
ec90d6fd03 Beatmap downloader improvements and fixes.
Updates:
- Added some buttons to downloads menu: clear inactive downloads, import beatmaps, reset search, and show/hide unranked maps.
- Small changes to OsuParser, OszUnpacker, and OsuGroupList (mostly adding return values) to allow parsing only newly unpacked beatmaps.
- Added alpha fade hover effect to MenuButton, as an alternative to expanding (used for 3-part menu buttons).
- Added text rendering fields to MenuButton (also for the 3-part menu buttons).
- Added sound effects to downloads menu.

Fixes:
- Check downloads for illegal filename characters, and remove them if necessary.
- The number of results and downloads shown now supports all resolutions.
- Confirmation dialog no longer appears when restarting the application (since downloads are static).
- Do not set a focus node immediately if the theme song will be played.
- Always play the theme song if no songs are loaded (even if disabled in settings).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-02 00:15:16 -05:00
Jeffrey Han
84e463e8fb Added a listener for the end of music tracks.
Fixes a bug during gameplay where if the music track ends before the last hit object is processed (esp. spinners), the game would hang.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-29 21:24:21 -05:00
Jeffrey Han
e93fe25834 Code style cleanup from #12.
- Moved all curve-related classes into a new package.
- Added some fields and methods to Curve abstract class.
- Removed the old (no longer used) Bezier subclass.
- Changed Error throwing to ErrorHandler.error() calls.
- Formatted code.

Also fixed a crash when reaching the ranking screen with the "Auto" mod active.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-29 20:36:23 -05:00
Jeffrey Han
0165abde56 Many quick bug fixes.
- Fixed bug when having "Sudden Death" and Easy "mods" enabled at the same time.  Additional "lives" are no longer granted.
- Fixed bug where GameMod active states weren't being reset upon restart.
- Fixed bug where GameMods were drawn as if inactive when viewing scores.  Alpha levels are now only set when drawing the button (i.e. calling GameMod.draw()).
- Moved large grade scaling into GameImage, and slightly padded the right side when drawing.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-29 01:50:26 -05:00
Jeffrey Han
1ddeb3461d Moved ScoreData to separate file and renamed Scores to ScoreDB.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-29 00:56:30 -05:00
Jeffrey Han
0bd72e731a Save game scores to an SQLite database. [Incomplete!]
Implemented basic features (mostly stable).  The remaining features are mostly graphical.
- Added package org.xerial.sqlite-jdbc.  All scores are saved to .opsu_scores.db on table `scores` after a game completes.
- Added "Scores" class to handle all game score data (including database connections).  The "Score" subclass encapsulates all database fields.
- Added "score viewing" constructor to GameData, for use only in the ranking screen.
- Draw the grade of the highest score next to expanded song buttons in the song menu.
- Added "bit" and "abbrev" fields to GameMod, used in storing/displaying scores.
- Hide the retry/exit buttons in the ranking screen when viewing a score.

Other changes:
- Removed "objectCount" field in GameData (no longer necessary).
- Removed "getID()" method in GameMod (no longer used).
- Moved most drawing in GameRanking state to GameData.
- Removed File parameter of "GameData.loadImages()" (leftover, no longer used).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-28 03:47:24 -05:00
Jeffrey Han
44bdf70c98 Renamed GameScore class to GameData.
Makes more sense, since the class is responsible for more than just the score.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-27 03:19:39 -05:00
Jeffrey Han
c9e14bfc70 Comment format changes.
- Collapsed Javadoc comments for all fields.
- OsuFile now has proper Javadoc comments.
- Fixed various mistakes with comments.

Some changes with enums:
- Changed Class.values() calls to values().
- Changed size() calls to a SIZE field.
- Changed valuesReversed() calls to a VALUES_REVERSED field.
- Removed 'static' from enum declarations.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-22 00:44:45 -05:00
Jeffrey Han
d6c7476b88 Removed some unnecessary SlickException throwing/catching.
Mostly leftovers from moving Image creation to GameImage.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-21 18:56:53 -05:00
Jeffrey Han
19476993f9 Options state refactoring.
- Renamed Options state into OptionsMenu, and created Options class for solely handling user options.  Moved everything unrelated to the actual options menu into the static Options class.
- OptionsMenu no longer has static fields.
- Refactored option tabs into an enum, which makes the code much cleaner.

Also fixed a bug where global volume wasn't being used on container initialization.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-20 23:56:10 -05:00
Jeffrey Han
e2c1f2f937 Small memory optimization: reuse audio File objects in song groups.
Each song group references the same audio file probably 100% of the time, so don't create duplicate objects.

Also, follow-up to 3b13cc7: the up/down arrow keys now change global volume in the main menu and game states (in addition to the scroll wheel).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-20 22:19:14 -05:00
Jeffrey Han
f98edf8fc8 Enabled application restarts.
- Pressing Ctrl+Shift+F5 in the options menu restarts the game.  Beatmaps and sounds are not reloaded.
- Use GameContainer.setForceExit(false) to trigger a restart after exiting.

Other changes:
- Fixed general issues with track pausing/pause states.
- Store all background images loaded in OsuFiles in a static hash table, instead of in individual objects.  This allows easier access to the allocated memory.
- Only delete OSZ files if they were unzipped. (They were previously deleted in all cases.)
- Moved more images (mods, playfield, lighting) into GameImage.
- Moved OsuHitObject initialization inside Utils.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-20 19:01:18 -05:00
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