DungeonGenerator | Procdural dungeon generator for Unity3D | Generator Utils library
kandi X-RAY | DungeonGenerator Summary
kandi X-RAY | DungeonGenerator Summary
Procdural dungeon generator for Unity3D
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DungeonGenerator
DungeonGenerator Key Features
DungeonGenerator Examples and Code Snippets
Community Discussions
Trending Discussions on DungeonGenerator
QUESTION
I wrote a random Dungeon generator, that gives me coordinates like this(S= Start):
Now I would like to print my coordinates on a JPane (or whatever is common for that), but I have no clue where to start ;-(
I saw that I can paint something like rectangles or triangles on a JPane, so I tried to overwrite the paintComponent Method for the Graphics Object with my Console Output function (that is exactly the same, except that I draw instead of print())
...ANSWER
Answered 2017-Dec-23 at 07:59The smallest rendering unit is a pixel, which is, for argument sake, a little square which 1x1 in size.
When rendering something, you need to make your shape large enough to be visible for your needs, yes, you could use a pixel, but if you're like me and have spent to much time staring at a screen, you're probably going blind, so you might want something which is a little bigger.
When doing this, you also need to offset the location of the shape so it doesn't overwrite something else which is painted.
So, for example, if you have a square is 10x10, which is painted at 10x20, the next element will need to be at 20x20 to painted in the next column or 10x30 to painted on the next row, as an example.
Now, I've just hacked the maze/model together, as it's basically irrelevant to the question and demonstrated the concept of painting columns and rows of information.
QUESTION
I would like to generate some random coordinates, from a start location in the north(x=10,y=0)
, west(x=0,y=10)
, east(x=20,y=10)
or south(x=10,y=20)
. (for a random dungeongenerator, just for a hopefully funny project ;^) )
ANSWER
Answered 2017-Dec-11 at 14:06Hard to see the complete story from this snippet but it looks as though your first if statement is passing and you're calling generateDungeon without incrementing groesse. This would explain why it looks like the code is "jumping back" to the following line if(tempY==1) because that is the first line after the method call.
I'd suggest debugging through the method step by step, keeping track of groesse and also the values of tempx/tempy
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DungeonGenerator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page