My gravity & spaceships game.

I made another cool(as I think) game. This is a demo for now, but it’s good already.

spaceship_demo.blend (528 KB)

In this game are two spaceships(one you, and one NPC) and a little planet. The NPC guy just follows you for now.

The best thing in this game is that I made a script for gravity — I turned off the BGE automatic gravity. This gravity works between the planet and the spaceships. The gravity attracts (i.e. applies force) both (the planet is a rigid body).
I even used the real formula for gravity:

Force = mass1*mass2 / distance[SUP]2[/SUP]

I added a coefficient just to balance the small Blender units for mass:

Force = mass1mass2coefficient / distance[SUP]2[/SUP]

More you find in the script itself. Now to the game!

Controls:

Mouse for steering the spaceship. (e.g. mouse moves left = spaceship turns left)
Right mouse button for accelerating forwards.
Left mouse button for shooting ( just for fun!).
A/D buttons for rolling.

Warning: don’t accelerate too much, you can fly out and not find a way back!

I find this game relaxing. Hope you ENJOY! :smiley:

Note: feel free to use this gravity script in your games. But credit please.

2 Likes

Can we see screenshots or video?

Here you go:


<– flight

<– shooting

<– my bro

Hope you like it :slight_smile: