ScriptaGames / zorbio

A 3D multiplayer WebGL game
MIT License
8 stars 1 forks source link

Move bots along curve path #388

Closed Jared-Sprague closed 6 years ago

Jared-Sprague commented 8 years ago

Instead of moving in a strait line and making a hard direction change, I think it would look cooler if they moved more naturally. I got a POC started in branch: https://github.com/Jared-Sprague/zorbio/tree/bot-curves

That is based on this example: https://threejs.org/examples/?q=spline#webgl_geometry_extrude_splines

Click on the camera spline animation button ON to move the camera along the path. Same thing can be done with any 3D object. The tricky part is that it moves by positions calulated alonge the line, not by direction and applied velocity like we do now. So adjusting speed would be tricky.

Jared-Sprague commented 6 years ago

I really want to make the bot path more interesting, I think that would make the game more fun for remastered.

Jared-Sprague commented 6 years ago

Got a start on this, by borrowing from this example: https://threejs.org/examples/?q=spli#webgl_geometry_extrude_splines

curvs

in branch: https://github.com/Jared-Sprague/zorbio/tree/bot-curves-388

I just need to put together a collection of the best curves that work and look natrual. Also have to figure out the default for each curve to make them fit within the world. Have to avoid sharp changes in direction like the heart for example. I'm going to try to chain together a few curves for each bot so their pattern is not so obvious.

Jared-Sprague commented 6 years ago

@mwcz ready for testing!