This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
billysback's profile picture

My Java Engine (or library) !

Started by billysback, 26 October 2012 - 06:13 PM
billysback #1
Posted 26 October 2012 - 08:13 PM
Freedom2D


I am nearing stage one of the completion of my engine/library named "Freedom2D" because it was the first name that sprung to mind;

It has basic physics support (at the moment it is nothing par a collision detector between custom hit boxes), It has shader support created in my own way and has general drawing mechanics to make processing and drawing the game easier.

What I am most pleased about it is my shader:
SpoilerMy shader must, as you would expect, render on every update of the screen, or total render, however the way I have programmed it is so that only the final resulting pixels are affected by the shader, not whilst drawing each sprite.

This means that if you have a lot of sprites stacked then it will only affect the pixels that come out on top of that stack, it won't needlessly shade all of those sprites.

It also runs along my own equation; the shader works by deciding the distance between the pixel and a "light point" then creating a "shade" value. All of the shade values affecting the pixel from all of the light points are added together.

The resulting shade value is added to the r, g and b of the pixel, if any of these go over 255 they are set to 255. If the shade value is less than or equal to the r/g/b value then it reduces the r/g/b value by the shade value flipped according to the r/g/b value (example: r = 50, shade = 49. shade flipped and taken away from r, result is 50-1, 49.). It then sets the pixel to this new r/g/b value.

The drawing is split up by two, Tiles and Entities.
Tiles are set, they are not abstract but are instead customizable in settings.
Entities are abstract, you must create a new Entity class for each Entity you wish to be in the game.

The engine incorporates these two in to a easy-to-use map class.

The engine also contains a simplified Controls class which is basically a dumbed down version of MouseListener, KeyListener and MouseMotionListener.

I plan to add a AI Path finder but want to test it a bit first, I will add a link to the .jar library:

DOWNLOAD IF YOU WANT IT:
Spoilerhttp://www.mediafire...7zab9n6eecfw602
( I realize this is suspicious but as I can't figure out GitHub :D/>/> and there isn't much to take pictures off I just say download this under my honesty, if that isn't enough then don't download it… )


NOTE:
This engine was created with both me and others in mind, it was created in a way that was user friendly and safe & simple to use but in a style which suited the game I had in mind for it.
Teraminer #2
Posted 26 October 2012 - 08:26 PM
You just run it right?
billysback #3
Posted 26 October 2012 - 08:29 PM
No, it's a Java library, you add the Library in to your project and you can use the classes.

It doesn't have a tutorial of any type because it is mainly for people to look at the code and possibly use if they figure it out themselves rather than to use it as an engine/library just yet

(This is kinda false advertisment, it is kinda an engine but kinda mostly a library?)
Teraminer #4
Posted 28 October 2012 - 06:43 AM
Oh, well I don't know java.
SN:Is it something like an API (Forge or Modloader or FML?)
billysback #5
Posted 28 October 2012 - 07:53 AM
Kinda, but then no.

The main feature (kinda) is the "Base" class, you initiate this class with a load of variables and then that class uses those variables to set up the game for you. Now using the base class you can modify and add to the game to make it personal.