Friday, January 16, 2015

[MMc] Solar Golfing UI Done

I've created planets with appropriate gravity and randomized terrain, a ball with the desired physics, and a UI for hitting the ball. The atmosphere is not just visual--it indicates the region within which the planet's gravity is constant, to allow somewhat normal golfing around the planet's surface. Gravity then falls off quadratically outside of there.

Solar Golfing in development with all rendering and physics done



I'm about an hour behind schedule. I was too optimistic about the time to implement the interaction UI ("it's just an arrow!") and the time I'd need looking at other games to figure out how they handle some situations. Some things I learned:


  • Desert Golfing doesn't create the force arrow until the player has dragged a certain distance. This ensures that even for small putts there is still a fairly accurate direction, since the vector has direction before it has magnitude in that scheme.
  • Desert Golfing's ball and arrow can be white because everything else in the game is just fairly dark brown. I needed subtle outlines on mine to make them visible against all background colors, including space.
  • A rolling ball rolls way too much under the simplified physics of a video game. Increasing friction doesn't help--that's static friction, not rolling friction. I made the ball not rotate in the physics system (since you can't tell--it is a circle) and instead gave it a very low sliding friction coefficient. This created the feel I wanted.
  • There is no way to draw a thick disc-dotted line on an HTML canvas. There is a way to draw a dashed line, and it is strangely different (albeit better) than the API for all other styles on the canvas API.

 The next steps are:

  • Apply impulse on drag release
  • Make the tee (right now, the ball drops out of the sky at a random point)
  • Make the hole
  • Make an indicator as to direction when the hole is not on screen
  • Make the view track the ball
At that point I'll have a complete game, and can experiment with the fun of inter-planetary shots and procedural planet generation.

No comments:

Post a Comment