Hello! If this is your first time reading about my thirty day developer challenge, click here to go to the first post!
Four corners, or 4orner, is the tentative name I've settled on. And I am proud to present the first version that I am proud to call a working prototype. Obviously everything is still largely a work in progress, but this is the first time where I think that my game has the absolute bare minimum requirements to be called a game.
4orner! |
So if you've been reading the blog entries in the past, you'd know that I had a problem with getting the trajectory of the ball correct upon mouse release. So the method I settled on is a mixture of the old mouse history velocity method and a directional method.
First, I use the historical positions of the mouse to create a temporary velocity. This way, if you've been dragging the ball for a bit, it'll be faster when you let go. But this led to an issue with sharp turns right before the release of the ball. Therefore, I added a second portion where it'll determine the correct direction the ball should travel in using the position of the mouse during the last two milliseconds. This way, even if you do a sharp turn while dragging the ball, it'll travel in the correct direction upon release.
I still don't know if this method is the most efficient, but it seems to work fine for the interim. Obviously there might be issues with sharp movement that may be faster than the two milliseconds I allotted for, but that seems unlikely.
On a side note, maybe nine days isn't much of an accomplishment to some of you folks out there, but to me this is a huge achievement and I am beyond proud of what I was able to do in such a short amount of time.
Comments
Post a Comment