Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

I'm so curious as to how you made the surface of the planet possible. It seems like a "simple" vertex shader, but the way it affects the enemies and projectiles as well throws me off. Easy 5/5 on technical implementation, easy. Good job, and wow!

(1 edit)

So to get projectiles and enemies to go around the planet, you must first understand orbital mechanics! /jk (only just a little bit)

I used Unity, and I know you use Godot so I dunno how well this will translate, but I tried to keep it simple. I made all objects physics-based (rigidbodies), and disabled their gravity. I then applied force every physics frame in the direction of the center of the planet at a constant force equivalent to 9.8 meters squared (Earth's gravity). And that's all there is to it for a simple orbiting effect! 

I could apply force in any other direction (like a bullet), and if that force ends up meeting or exceeding the downward force, it'll enter orbit. You can see this happen sometimes with the shotgun or gatling gun powerups due to random force being applied to their bullets. 

Thanks for the comment!

(+1)

Thanks for the write up! That translates perfectly to Godot :) I was thinking more of the geometry of the surface though, the player seems to dip into the "bumps" on the surface, or am I just hallucinating? Is that a complete mesh with collision shape?

Oh, the planet is just an ICO sphere in Blender that's had a displacement effect with the texture settings Clouds > Blender Original.  It's a toon shader with rim lightning. I unfortunately didn't have the time to implement shadows, so you can't easily see when you're dipping into the terrain.