I'm quite new in programming and especially with javafx. I'm writing a game and i'm trying to visualize at the same time more instances of the same sprite ( a kind of bullet). It translates and rotates. In my attempts program doesn't work or normally when press 'fire', bullet run but when press 'fire' more times, every time the 'old' bullet' disappear and another bullet starts. Only 1 bullet on the screen at the same time. What have i to do to have more bullets on the screen, exactly one bullet for every time 'fire' is pressed? Thank you in advance!
相关问题
- Do the Java Integer and Double objects have unnece
- I get an exception when trying to swap elements in
- JFX scale image up and down to parent
- Dragging an undecorated Stage in JavaFX
- How do I create a multidimensional array of object
相关文章
- Poor Use Case of Object.assign() - Simple Example
- Low quality icon in taskbar of a Stage. JavaFX
- Where is the object browser in visual studio C# 20
- Implementation Strategies for Object Orientation
- Loading custom font using JavaFX 8 and css
- An object reference is required for the non-static
- Javafx Platform.runLater never running
- How to use object spread with nested properties?
You are probably trying to add the same node more than once to the scene graph.
From the JavaFX
Node
documentation:Here is a sample of multiple animated images in a single scene. In the example, multiple nodes are used, each sharing the same Image data. Because Image is not a Node, it can be shared without issue: