![]() ![]() The distance between two points ( x 1, y 1 ) and ( x 2, y 2 ) can beĭefined as d = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2Īssuming that you use the nested arrays, and limit the number of squares visible on any screen, it would not be dificult to use a bunch of divs with fixed height and width to visually represent your 'grid.' That way rather than just having numbers to look at, you could assign a background image to each div based on what it was, and actually have a map. (use the distance on a coordinate plane formula and replace X and y with Column and Row This would also easily allow you to choose what to show your Players as a function of distance from their position. If you use a 5 foot square, then you could use a nested array that is 12 'squares' to a side. If you assume that most characters in DnD 5e have somewhere between 20 and 60 feet of vision while in indoors, you can then assume that the visible area would not need to exceed 60 feet on any one side. To do this I would suggest you use a nested array that could represent your visible area. It sounds to me like you are trying to recreate something like but assuming that I am wrong here is the best I can come up with from your question. ![]() (you might realise i havn't reached that step with how few my ideas and explanations are written, this is all a mess in my head). And even before, finding a way to make the code realise the distinctions between all elements as rooms, corridors, etc. then, i shall find a way to display the areas one by one. The characters would have a certain value, for exemple the character called "Eowyn" would have a value of twenty, thus the code will update the tiles with the value of the character to accurately track them down on the map Letting them select their avatar before truly entering the dungeon by clicking on a button with the name of the character on it and assigning their computers onclick. Secondly, i shall create variables with the name of the characters that my friends play with. For exemple, zero would be the walls (unwalkable area) One would be the tiles composing the rooms and corridors as the walkable areas Two would be the doors Three would be the chests and so on ! ![]() First, i will create a tab in js that would represent the general layout of the dungeon (which i would manually recreate according to the dungeon's map i drew beforehand), the tab would be composed of numbers and each number would represent a specific object. I've been having a hard time for the past two or three months to get any steps in the right direction.Īt first i planned out the way i would construct the code and three major steps quite imposed themselves to me : Which is my principal motivation of doing so. As we're seprated by hundred and hundred of kilometers, thus we cannot play together (or at very rare occasions). I really like coding and never stop challenging myself as i believe that, to learn coding, regularly exercising is the key.Īnd here i am stucking to the last one i throw myself, my goal is to create a dynamic 2D rendered D&D dungeon map that would let my players evolve in my dungeons together. ![]() I am a beginner developer that is in first year at university. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |