Skip to content

Hamcrest When to use Is or equalTo

I’m new using hamcrest. While I’m discovering how to use it I have been a doubt about when to use is or equalTo. Is there any difference between is and equalTo, although it is conceptually or ocasionally? It seems to behave the same. Why do you would use one instead of the other? Answer The Javado…

Java Collision detection between different classes

I am making a simple game about shooting enemies and avoiding obstacles, but I have a problem with detecting collisions because I’ve got a lot of classes for every type of game object (player,enemy,obstacle,drop,bullet, etc.). And it won’t work because a doesn’t have ‘pos’, etc, …

Performance of JavaFx Gui vs Swing

I wrote two simple programs, both draw the same Sierpinski Triangle: One program was implemented using swing, and one using javafx. There is a very significant performance difference, swing implementation being consistently much faster: (In this test case : Swing over 1 sec. Javafx over 12 seconds) Is it to b…