JavaFX Game Issues with wall boundaries - javafx

I am having trouble getting my simple JavaFX Maze Game to work. I just wanted to do this to test how much I knew, and I have gotten almost to the end.
All I want to do now is see if there is a way for me to combine all of the Rectangle2D Boundaries into a single bounding shape for me to do collision detection with.
Right now, I have maze walls set up like
this, and I have to check for collision against every single one of the wall objects, which I have contained in a list.
What I want to know is there anyway of turning that into a single shape that I can check collision against. That would make my job so much easier when it comes to finishing my game.
EDIT 1: The red boxes in the image are just there to represent the Rectangle2D bounding boxes. They will not actually be there in the final product.
EDIT 2: All of these have been created using a simple black square sprite, and all of the bounding Rectangle2D boxes are using the javafx.geometry package, not the javafx.scene.shape package.
Any help would be appreciated. Thanks in advance!

Do you mean union many shapes into one?

Thanks to the help of the comment thread on Powercoder's answer, I was able to get it figured out. Instead of using javafx.geometry classes, I was able to switch to javafx.scene.shape classes, which allowed me to finish everything I was trying to do.
Here is my old code: https://pastebin.com/1DBXuq79
and here is my new code: https://pastebin.com/uXTrcsZ2
For anybody who wants to compare and figure out how I changed it.

Related

Need to outline several contiguous areas on map

I am working with maps that are based upon the lot and block survey system. So, for example, my house could be a parcel identified by block 34, lot 2. For every block, there are usually multiple lots and they are all within the same contiguous area. My users can query for block and lot, and the map will zoom in and display that exact block/lot and outline it. What they want to do is to show all lots for a specified block and draw an outline around the entire block.
I can use the JavaScript API and QueryTask execute() method to get all of the lots/features for a block. However, I do not know if there is a way to aggregate the feature data such that I can calculate and draw a border surrounding them all.
I have tried the executeForExtent() method and it works, but the extent, of course, is a rectangle, which means that while the outline will encompass all of the lots, the edges will have partials of other blocks and lots.
I know it's possible because I have seen it, but I do not have access to that code or the folks who developed it.
Does anybody know of a way to create an outline such as the one I'm describing?
TIA
I think you're looking for a way to calculate a convex hull which you can do with the geometry engine in the ArcGIS API for JavaScript. See https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#convexHull
Update: or maybe better the union method as suggested by #cabesuon in a comment below. Same basic principle - use the GeometryEngine :)

Why are my objects keep multiplying and making a path in gamemaker?

I am new to GMS2 and was coding up a game when this happened:
enter image description here
It would be of great help if anyone could help me
Most likely it's not objects that are multiplying, but that you don't have a background in your room, so whatever was drawn during the last frame stays there.

QGraphicsPathItem eraser / Splitting QGraphicsPathItem into two new ones

I am working on an application using Qt5 in which you can free hand draw arbitrary shapes in vector graphics, move them and and partially remove parts (just like an eraser in Microsoft paint).
I draw the shapes in QGraphicsScene by adding QGraphicsPathItem and move them using the QGraphicsItem::ItemIsMovable flag. The question of the eraser remains.
Has anyone faced the task of partial removal of QGraphicsPathItem? Especially in a situation when we divide the figure into two (or more) parts with an eraser and these should become separate new QGraphicsPathItem ? Is it possible to implement it?
Thanks for any help!
Coincidentally, I am making a similar application. My app only involves d0freehand drawing. I am using mouse events to add or erase. I started with this and modified it alot. I am keeping a using a selection buffer to select an object and using matrices to move them.
To answer your question, for partially erasing :
Divide previous item two items
Delete the previous item.
Redraw the new items.

Can timeline and network models be combined?

I am looking to outline a set of nodes that are created over time, and related to each other. D3 has a way to render nodes over time, and I could try to add links to this model.
https://bl.ocks.org/mbostock/6526445e2b44303eebf21da3b6627320
I'd like to use vis.js for this... where I distribute nodes based on their time of creation, and connect them to each other based on their relationships.
Then, asking for the impossible, I will ask that one cannot move them on the X axis but can move them on the Y-axis, to be able to analyze what is going on...
Any pointers are welcome.
I would add this as a comment but I dont have a high enough reputation. I saw a similar question where the user was wanting to combine the timeline and graph2d module together. I hope it can help point you in the right direction.
How to draw line graph on timeline using visjs?

How to make correct PathFinding for large size entity in cryengine?

I have been confused by the pathfinding problem for a few days, it seems that the space between generated path and forbidden area are constant. I am really dry, and did not find anything relating to my question on official documentation.
I have tried to modify "pathfindProperties.xml", there is no difference when switching different "Type"
Scale up the radius of collider
is there anybody can give me a help? I really appreciate it!
{A screenshot of my question: http://www.crydev.net/download/file.php?id=86461}
After investigating the problem, I found a solution:
To use the Multi-layer navigation mesh, rather than the default navigation system. And define a proper volume for actor via "NavigationType" property.

Resources