Skip to content

Comments

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

Open
Windspar wants to merge 1 commit intoashish2199:masterfrom
Windspar:boundary
Open

new Boundary class. replace RectBoundBox. change int to double#53
Windspar wants to merge 1 commit intoashish2199:masterfrom
Windspar:boundary

Conversation

@Windspar
Copy link

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
Copy link
Owner

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants