Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Custom Made Java Coding Library

Options
  • 02-04-2015 1:58pm
    #1
    Registered Users Posts: 15


    As I was recently making a game using no libraries, I had come across a problem while trying to import Sounds, Images, etc... So I devised a couple of classes that are useful for game developers and normal coders, these include:

    ExceptionPrinter:
    Useful for printing custom exceptions, comes with three methods (Constructors).
    1) For printing an exception and a message.
    2) For printing multiple exceptions and a message.
    3) For printing an error message and shutting the program down.

    ImageParser:
    A simple way to import an image to use with the Graphics components, comes with one method:

    1) Returns an image ready to be used with the argument URl passed through. To be used with the Graphics Component

    Includes Getters:
    getParsedImage: Returns an image; the parsed image.

    MouseButtonParser:
    Useful to detect if the mouse is hovering over any buttons. One method:

    1) Returns a Boolean if the mouse is hovering over the arguments passed through.

    Includes Getters:
    getMouseHover: Returns a Boolean to see if the mouse is hovering, kinda useless...

    SoundParser:
    One of the most useful. Used to import sounds with the URL argument passed through. One method:

    1) Returns an image with the path specified.

    Includes Getters:
    getParsedSound: Returns a sound; the parsed sound
    getAudioPlayer: Returns a Clip. Needed to play the parsed sound

    This library will be updated overtime, and the MouseButtonParser Class is still in beta, expect it to glitch.


Comments

  • Registered Users Posts: 1,275 ✭✭✭bpmurray


    I presume you're talking about an OpenSource project that you plan on uploading to GitHub or SourceForge or somewhere similar. What's the URL?


  • Registered Users Posts: 15 SherRao


    Oh sorry, I totally forgot to post the link to the JAR File (Cause I'm a smart person), I'll edit the post with the URL


  • Registered Users Posts: 15 SherRao


    URL to the JAR File containing all the classes, just add this to your build path and import the classes using:

    import net.sher.game.shertools.*;

    URL: drive.google.com/file/d/0BzetpZdU9hBLQWtDaDhPTUk4M2M/view?usp=sharing


  • Registered Users Posts: 2,030 ✭✭✭colm_c


    Stick it up on github, more developer friendly than a Google Drive link.

    Also are you planning on maintaining it? Would you like other people to contribute to it? Have you written unit tests?

    If so, it might be worth to put the source up on github along with the JAR so anyone can take it and extend it. Makes it infinitely more usable.

    Personally I wouldn't include a randomer's JAR file in my project unless I knew the source was available to browse.


  • Registered Users Posts: 15 SherRao


    Thanks for the advice Colm,
    I was thinking about GitHub for a while, but never got around to it. Nevertheless; here is the link to the GitHub Repoistory: github.com/SherRao/Java-Game-Dev-Library/

    Regarding your other question, yes, I will try to maintain it as much as I can (when I have time free from School and Gaming ;) ).

    If anyone is willing to contribute, feel free, just don't overdo the code for anyone who is starting to code in java, trying to keep the library simplistic. If you do decide to contribute, don't forget to include Annotations for all the arguments.


  • Advertisement
  • Moderators, Computer Games Moderators, Technology & Internet Moderators Posts: 19,240 Mod ✭✭✭✭L.Jenkins


    Any chance you could upload Java files instead of a Jar? I could decompile it myself, but it would be nice to have directory structure to browse through instead


  • Registered Users Posts: 2,030 ✭✭✭colm_c


    SherRao wrote: »
    Thanks for the advice Colm,
    I was thinking about GitHub for a while, but never got around to it. Nevertheless; here is the link to the GitHub Repoistory: github.com/SherRao/Java-Game-Dev-Library/

    Regarding your other question, yes, I will try to maintain it as much as I can (when I have time free from School and Gaming ;) ).

    If anyone is willing to contribute, feel free, just don't overdo the code for anyone who is starting to code in java, trying to keep the library simplistic. If you do decide to contribute, don't forget to include Annotations for all the arguments.

    Good stuff!

    You should include the source on github if you want people to contribute with appropriate folder structures (e.g. src, bin etc.)


  • Registered Users Posts: 15 SherRao


    Yep Colm, I'm just working on copying the files to a separate project, I'll have the link in a few.
    And sorry about the GitHub not showing the raw classes, couldn't figure it out, cause I've never used GitHub, except when I browse people's work


  • Registered Users Posts: 15 SherRao


    Yep Colm, I'm just working on copying the files to a separate project, I'll have the link in a few.
    And sorry about the GitHub not showing the raw classes, couldn't figure it out, cause I've never used GitHub, except when I browse people's work


  • Registered Users Posts: 14,329 ✭✭✭✭jimmycrackcorm


    SherRao wrote: »
    As I was recently making a game using no libraries

    I'm curious why you would try write a game without libraries? Unless it is as a learning exercise in which case sharing it may not find a wider audience.


  • Advertisement
  • Registered Users Posts: 15 SherRao


    I'm curious why you would try write a game without libraries? Unless it is as a learning exercise in which case sharing it may not find a wider audience.

    As I have used libraries in the past, I felt that I would try (as a challenge) and use no libraries. Of course, for a proper game LWJGL is the way to go. I just felt like challenging myself and making a high-standard game, without using libraries


Advertisement