ashish2199 / Aidos

A beginner friendly project with aim of creating our own version of Bomberman.
GNU General Public License v3.0
41 stars 27 forks source link

new Boundary class. replace RectBoundBox. change int to double #53

Open Windspar opened 6 years ago

Windspar commented 6 years ago

Change some int to double . For better entity movement. Boundary class is pretty close to javafx design. When there a map class. Boundary getCorners could just check map position. Instead of every stationary entity.

ashish2199 commented 6 years ago

I understand about changing from int to double and that it will lead to better accuracy.

What I didnt understand was why the current implementation was removed instead of modifying it. Can you explain why you needed to changed the boundary implementation ? What are the functionalities that you feel you have achieved through this ? Maybe you could explain the changes in more details and why you made them.

Windspar commented 6 years ago

Boundary class has same naming convention as Rectangle2D . All methods that work with Rectangle2D works with Boundary. I could just have just modify RectBoundedBox. But there was nothing left the same. From my experience with python pygame and D and Derelict. Fully functional rect does make programming whole lot easier. Boundary handles alot simple math. In my experimental version I use it for my Grid geometry. To make Map class. To simplified collision check. So at most you only check against max of four stationary entity. Instead of hundreds. Main change is all Rectangle2D methods names are the same. In case project decide just to use Rectangle2D or use Rectangle2D in some parts of the program. Other thoughts I could just extends it with Rectangle2D. Would have to create a new Rectangle2D for almost every change. It probably be low cost in doing that way. Then you could just pass it as a Rectangle2D. I going to do that and compare them.