Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
3 votes
Accepted

X axis intersection with inverted Y axis coordinates

This is way too complicated. Let's say the screen center is at (0,0), the asteroid coords are x,...
user avatar
  • 1,875
2 votes

How to find the mathematical relationship between 2 variables?

The same strategy I explained in this answer I showed you works here too. Take your table of numbers and paste them into a spreadsheet. (I used Google Sheets for this example) Select the two columns ...
user avatar
  • 113k
2 votes
Accepted

reposition object in circle

For circle p2 and p3 to be close enough to eachother to touch, we know that the distance between them must be ...
user avatar
  • 4,241
2 votes
Accepted

How to sort leaderboards, given wins and total games played?

One option is to add a constant to both values: RankScore = (Wins + Inertia) / (Total + 2 * Inertia) I called this constant "Inertia" because it creates ...
user avatar
  • 113k
2 votes
Accepted

Finding the position of a point based on a relative point inside a quad

Assuming that your quad is convex, you can solve for an interior point using a few linear interpolations (lerps) between the corner points of the quad. To illustrate, consider finding a point (R for ...
user avatar
  • 8,595
1 vote

Rotate an object relative to the player to face another object

The relative distance between the shield and the player is a fixed length instead of a fixed offset. Record this fixed length and calculate the position according to the rotation. ...
user avatar
  • 721
1 vote

Predicting Inclines and Declines for projectiles

Thanks to @DMGregory, they guided me in the right direction and I got it done. Briefly, what I did is this: Every time a new map is created, I also create a heightmap (a 2D array containing all ...
user avatar
  • 11
1 vote

Finding the position of a point based on a relative point inside a quad

Find the points on the four sides according to the proportion, and then find the intersection of the two segments. Code: ...
user avatar
  • 721
1 vote
Accepted

Matrix math: How to specify camera distance so that an object with a given size is completely visible?

If your field of view is measured from the bottom of the frustum to the top, then at a distance d your frustum is h units tall, where: ...
user avatar
  • 113k

Only top scored, non community-wiki answers of a minimum length are eligible