This is raycasting implementations.
This project is only a draft and the code quality is bad.
There is two implementations :
- 2D with App.java
- 3D with App3D.java
If you launch the 3D app, 2D and 3D renderings will be launched with the same scene.
There are some keybinding :
z
to move forwards
to move backwardq
to move leftd
to move rightj
to look leftm
to look rightescape
to quit
The maps are defined by points, and segments (defined by two points);
To create a map, you must create points, then link the points to create walls.
IMPORTANT: Add frame all around the map must be created.
There one line per point, segment or origin.
Point lines are defined by the following nomenclature :
p:x;y
Segment line are defined by the following nomenclature :
s:numberPoint1;numberPoint2
Origin is defined by the following nomenclature :
o:x;y
For example :
o:50;150
p:0;0
p:300;0
p:300;300
p:0;300
s:0;1
s:1;2
s:2;3
s:3;0
First you need to create a map as described above.
Then upload to the maps
resource folder.
And finally, find and edit the line with map = Map.fromFile("maps/map.txt");
.