FrogGier - Two Player Battle Game

Discussion in 'Computer Programming, Emulation, and Game Modding' started by jonthedit, May 22, 2014.

  1. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Thread Updated as of 4/26/2015 : 11:11am GMT -7

    | |
    Hey GBATemp! Today I present to you...
    FrogGier!
    What? Expecting a cool logo? Maybe later.


    v1.2 - The Final Update and Afternote
    Today, 4/26/2015 at 11:11AM GMT -7, I release FrogGier-v1.2- one JAR with the music and one without. I have learned quite a bit from this project and am happy to say this is as far as this project can go. The code is such... I will put this nicely... "a mess" that it is basically impossible to make true all-resolution support [scaling], implement AI, Online, and Multi-Frog Battle without rewriting the whole project from scratch. The "speed bug," as I have dubbed it, is unfortunately not fixable with the way I wrote the game loop. To fix it, again I would have to rewrite my code from scratch. The good news is I know exactly how I caused this bug, and how to avoid it in the future.
    With exactly 3607 lines of code [not including spaces/formatting gaps], "FrogGier Classic" has received its last update.

    A new game, superseding "FrogGier Classic" will be released mid-Summer this year will eventually come out, probably late 2016, supporting Multi-Frog Battles and an improved map system. Online, AI, and more will be implemented in a proper-resolution supporting project.
    Enjoy the final version, v1.2.


    Introduction
    After approximately two-weeks of (at least) 8 hours of coding per day (Mind you, with no Java experience!) I have produced my first game EVER!
    Rather than aiming to create the next CALL OF BATTLEFIELD SWAGGG 1ST PERSON SHOOTER, I decided to make a basic 2D two player versus game. Where was I going to start? How was I going to start? I had no idea. I decided "The Temp must know!" and so, I posted here.
    (Convince me to learn java thread)
    I posted and asked for reasons to learn a specific language, Java. I received mixed results.


    So I decided "Fuck it!" JAVA IT IS!
    I read a textbook I piratedbought online that supposedly taught java. I read the first two chapters and banged my head on my desk. I accepted that no textbook was going to actually teach me Java. I was going to have to go by the trial-and-error method. Experience is key, they say! So, I made many many many many many errors, did not understand what I was writing, went in circles, and even reinvented the wheel a few times. (I DID NOT KNOW THERE WAS an '.intersects' method I can import with G2D!!! >:|)
    But after all my confusion and learning, everything ended well.

    I struggled with Java, but now I feel confident I can produce nearly any basic level game or program using the language.

    Requirements
    - JRE 8

    - 1600x900 or 1920x1080 Resolution Supports All Resolutions as of v1.2!
    - Numpad


    Screenshots
    Windowed Mode

    What Did You Use?

    • Eclipse SR2 [2014]
    • JRE 8 and JDK 8 [the day they came out! :)]
    JRE 7 Update 60 works, but has performance issues.
    I highly recommend getting JRE 8 for this application.
    • 1600x900 Monitor [The only compatible Resolution as of v1.0rev5]
    • GIMP (for image design)
    • INCOMPETECH for Music - [As of v1.1r3] - Own music as of v1.2
    What is with the strange Co-Op "Boss Battle"?

    • I made this section of the game specifically because I HATE DEVELOPER WHO SKIMP OUT ON THE COOP! Take Crysis for example, Crysis 2, Crysis 3, Call of Duty(s), FarCry(s), [PROTOTYPE], GTA, (The campaigns should be Co-Op! It would be a blast!), etc the list goes on. I had to have a Co-Op section! There is a 1/4 chance you will encounter the boss on a reset.
    So, without further ado, HERE IS MY DEMO FOR FrogGier!

    1.0-rev5 Demo





    Special Mentions to calmwaters and Foxi4 for inspiring me... and fixing some of my problems.
    (paintComponent Java Help Thread)





    Changelog
    Changes from FrogGier v1.1-rev3 to v1.2
    Code:
    ==Bugfix
    - P1's HP Label Collision Fix
    - Fixed Occasional Missing HP off of Boss / Undeserved Gains in Player HP on a Restart
    - Fixed Rare HP Growth Bug
    - Fixed 'Non-Movement Freeze' Boss Bug
    ==Enhancements
    - Supports all Resolutions, minor issues on non-officially supported resolutions
    - Music System Updated - Works properly finally. Menu-Toggle working, Boss Theme added
    - Animations - P1, P2, vP1, vP2 now have movement animations
    - EdgeWarping is now smooth instead of sudden
    - Boss positioning & mode boundary for all res fixed
    - Car positioning fixed for all resolutions
    - Added two new M0dG4m3 entrys [player velocity, collision pushback value]
    - New Music
    - New ResourceLoading Method
    ==Optimizations
    - Improved Image loading for Frogs and animations
    - Fixed Menu Label spacing maximums [for highest available resolution]
    - Fixed Menu Refresh Problem [labels not showing up until mouse pass]
    - Fixed Ball Boundary Memory Leak
    ==Known Issues
    - Speed Bug (Probably will never be fixed in 'classic FrogGier')
    - Slight Windowed/Fullscreen offset issue
    DOWNLOADS....

    Java 8
    v1.2 [9.2MB] - MEGA
    v1.2-NoMusic [767KB] - MEGA
    Source

    Old Versions
    All Old Version Changelogs
     
    Last edited by jonthedit, Dec 8, 2015 - Reason: Updated Source Link - Misused GIT first time (initial source release date October 13, 2015)
  2. BlackWizzard17

    BlackWizzard17 Don't worry Captin we'll buff out those scratches.

    Member
    1,116
    362
    Dec 1, 2012
    United States
    E-Arth
    :grog::grog::grog::grog::grog::grog::grog::grog::grog:

    Nice job dude, you became that successful person
    Pretty neat game, especially when you incorporated ally mode all of a sudden and it changed to a different mode.
    It reminds me of frogger And might I say I am a big fan of frogger:bow:
    Oh and any recommendations on any methods to learn java via through textbooks or videos that would be great as this makes me wanna learn java.
     
  3. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    The 'coop mode' was the easiest part to create actually. All it took was a variable and an "if" statement in each timer related to actions (teleport, collisions, ball location etc).
    With my restart() method, I just created a random event that picks a number and if it meets that criteria "coop mode == 0 or 1".

    I will say the textbook I hate so dearly did help me out in the beginning. PM me and I'll send it to you (it no longer exists, the company went out of business)

    It was called
    "BLUE PELLICAN".

    **NOTE THE INFO HAS BEEN CHANGED TO REFLECT MY REAL NAME AND THOSE WHO HELPED ME IN REAL LIFE!
    **I have added "Team" because of the guys who helped code the Menu and create GFX for me!

    Self-Extracting Archive Download!
    --REVOKED-- (New release in OP)
    This is a temporary release of FrogGier!
    Installs to C:\Program Files\FrogGier (by Default)
    and runs ONLY in 1600x900.
    You need JAVA 8 and OCR A STD font file.
    Get it here:
    http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
    OCR A STD:
    (Included in .exe extractor! Check C:\Program Files\FrogGier)


    After the first run, to run the game again open FrogGier_Rev5.jar.

    **Music is DISABLED in this release because of compiling issues.
    Images are included, and editable- a flaw, because I can not reference the images inside the JAR for whatever reason. See THIS for more Info
     
  4. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Great news! Fixed up some code, added new features.
    Still looking for anyone who can solve the mystery of not being able to pack images/sound into the JAR file!

    JRE 7 Update 60 works, but has performance issues.
    I highly recommend getting JRE 8 for this application.

    Official Changelog:
    Changes for FrogGier v1.1r2
    ==Bugfix:
    - Fixed "Resetting" Override bug (occured after one player survives a boss battle)
    - Fixed 'AllianceCountdown' not appearing
    ==Enhancements
    - WinCounter now more vivid
    - 'SHIFT+R' now resets score
    - Added Modification Menu (Set your own values!)

    Changes for FrogGier v1.1r1
    ==Bugfix:
    - Fixed Issue in WinnerIndicator where the countdown would be overriden if the dead body is touched by STEAMROLLER, CAR, or BALL.
    -- This also fixes the issue where if both players die the last one to die is the loser.
    - Memory optimization (Speed bug should occur less often, still possible)
    - 'Exit' now instantly Exits (Would stutter on some machines)
    ==Optimizations:
    - Fixed Infobox Error
    - Removed Music Credit (Not Working)
    - Removed unused images and sound files from v1.0
    - Optimized Code (Less Junk)
    - Memory optimization
    ==Enhancements
    - Reset and 'END' now have confirmation windows
    - Resolution Information (FrogGier only supports 1600x900 atm)
    - Added 'WinCounter' (boss only counts if one player dies)
    ==Known Issues
    - In the [rare event] when both players lose to STEAMROLLER and STEAMROLLER
    is fought the next round, the players will instant-die, and after a second reset both be awarded 750HP.
    - Occasional HP issues (Odd values)
     
  5. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Updated FrogGier.
    Heads up the game is now 11mb because I packed the music in.
    Also, the font install is removed because OCR A Extended SHOULD be installed on most systems.
    If anyone has a font issue (the font does not look as intended) please post!


    Changes for FrogGier v1.1r3
    ==Enhancements
    - Now supports 1920x1080 in Windowed Mode
    - Windowed Mode
    - Icon now properly displays in Windows taskbar
    - Music Working! No toggles yet, option for on/off at launch
    - Added 'Plans' and 'Check for Update' on Menu
    ==Known Issues
    - Text not centered
     
  6. Goatsie666

    Goatsie666 Head Smithy

    Member
    150
    5
    Oct 26, 2014
    United States
    Portland, Oregon
    wow, kid, you really are amazing. do u have a 2ds or 3ds? you really need to get an app called petit computer. there is a manual u can buy with it. its really good at teaching Basic. my dumb ass was actually able to program some simple games. http://www.petitcomputer.com/
    i have the computer technic. i bought a few copies. i can give u one.
     
  7. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    [​IMG]
    [​IMG]
    v1.2-DeveloperPreview1 released. - Music is working but the supplied JAR does not contain the music class as it needs improvement.

    Now supports 1920x1080 and 1280x720 [kind of]
    This release is sloppy but contains a few fixes from v1.1r3.
    AI was removed in this preview, too buggy.
    Main point was to add better resolution support, and I am aware its awful, but it will do for now until I write if from scratch.
    Download is at the top original post.
     
  8. ilman

    ilman Gbatemp's Official Noise Eraser

    Member
    1,130
    243
    Jul 25, 2010
    Shibuya
    It's always good to see a new developer enter the scene. While I do not know Java myself (I'm more into optimised stuff like C++ and C# to an extent), I do believe it's a great start for beginners(although I do think Python is the best option for absolute n00bs).
    Quick tip about resolutions: you only need to specify the aspect ratio for the game to render properly. For example, my 1366x768 display cannot play this game, although it has the same 16:9 aspect ratio as 1280x720. In such cases, instead of using a predefined resolution(which may result in many exceptions for different resolutions), it's best to scale the 1280x720 resolution up or scale the 1920x1080 one down. With usually(I don't know how your graphics API works) a couple lines of code you can scale the entire window before rendering.
     
  9. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    I am aware of that.
    When I started this I made a HUGE mistake [I literally had 0 knowledge, I was basing what I was doing off a java book not game related] and based everything off a 1600x900 resolution, not relative to the display, but rather integers.
    Because of how it is setup Its a big pain in the ass to fix- its easier to just start over.
    Since this though, my new 3D project is properly setup and works with all resolutions [even 1x2, though you cant see anything!]

    I just wanted to push out a quick "improved version" seeing as I have not touched this for 6 months.
     
    Last edited by jonthedit, Jan 1, 2016
    VinsCool likes this.
  10. ilman

    ilman Gbatemp's Official Noise Eraser

    Member
    1,130
    243
    Jul 25, 2010
    Shibuya
    Okay, I can get that...
    Btw, I can recommend uploading the sources of your first few games to GitHub, so that everyone can see them and tell you if there are any mistakes.
     
  11. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    FrogGier v1.2 Final Is Released.
    See OP for details.
     
  12. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,451
    4,766
    Mar 17, 2010
    Norway
    Alola
    Heh, your experience with programming books is much the same as mine.
    I got a Visual Basic 6 For Dummies from my dad when I was like 12 because I had told him I was interested in learning programming. That book never taught me much of anything. It was filled with useless information and was far too slow so I never bothered to read it all after the first few chapters hardly taught me anything. I find that Google and a good IDE are better learning tools than any book. :)
     
  13. sarkwalvein

    sarkwalvein Professional asshole at GBATemp

    Member
    GBAtemp Patron
    sarkwalvein is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,697
    4,701
    Jun 29, 2007
    Germany
    Niedersachsen
    Totally OT, but why do you have a profile picture saying you died yesterday?
    Creepy...
     
  14. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Haha. I wouldn't say it was a complete waste. It was alright to get started. Though I agree with you, Google, a good IDE, and other people are far greater teaching tools!

    Oh, don't mind that, its just a joke from the EoF.
     
    Last edited by jonthedit, Jan 1, 2016
    VinsCool likes this.
  15. VinsCool

    VinsCool Insecure

    Member
    GBAtemp Patron
    VinsCool is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,509
    26,927
    Jan 7, 2014
    Canada
    Another World
    Definitely what's going on.
     
  16. jonthedit
    OP

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Long overdue, but source code is now public.