I was away from Game development for the last 3 months because now I’m starting my own company focused on web development.
On the beginning of the week I already started to miss java/game development so I decided just for fun to write a custom 2d engine from scratch.
No external libraries. Only pure java2d with pixel manipulation!
The engine already has:
- Dynamic Light(Ray casting);
- Normal Light(obviously =));
- shadows;
- draw functions (string,line,circle,rectangle,sprite,image etc)
- Collision functions (rectangle,circle,line);
- math functions (clamp,point distance etc);
- a* algorithm easy to customize and easy to use on your entities!
- write and read files with my own encryption method(3 lines of code to initialize);
- Tile map(easy to use and already optimized! Tested with a map size of 1000x1000);
And I think that is it. As I mentioned before, this is a project just for fun but I think it is cool to share with you guys and hear your opinion…
I’m aware 90% of people like to use libGDX and say that java2D does not have performance…
if you don’t know how to optimize it, but some metrics about the performance of the engine:
- about 100 entities using a* at the same time and not one drop of fps…(not java2d related, just a fun fact =P);
- 1000X1000 tile map;
- more than 10 dynamic lights on screen using ray casting;
What I want to implement on the next few days:
- Fog of war(Done);
- Entity collision using tiles as reference(Done);
- mini map(Working)
Some screen shots
http://s12.postimg.org/z584xx6f1/Screen_Shot_2016_03_06_at_12_44_22_AM.png
http://s14.postimg.org/55mgvmlc1/Screen_Shot_2016_03_06_at_1_18_33_AM.png
FOG OF WAR!
http://s18.postimg.org/73zdl2tmx/Screen_Shot_2016_03_06_at_7_54_06_PM.png
Entities + collision with each other!
PS: Green rect = player and the red rect are enemies following me;
Most of people would prefer to use aabb collision but if you have lot of entities this could be a performance issue, so I decided to work the collision
between them based on Tile position!
Currently 300 entities in the map.
Later I will post more Screen Shots