We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Our solar system
#1
DJTX452.000 is a simulation of our solar system. Who has suggestions for improvement?
[-] The following 3 users Like martmen's post:
  • AbsoluteBeginner, litdev, Scout
Reply
#2
Hello!  Smile

I like this.
When I was looking at the movement of the planets, I wanted to be able to place a "cosmic body" at any point on the screen.
I'm interested to see how this "body" will begin to move when the gravity of other planets begins to accelerate it.
The value of the mass of the "cosmic body" can be set in the settings (in the code).
The initial position of the "body" can be set by clicking the mouse on the screen.

Rolleyes
Reply
#3
Hello.  Shy
It would also be interesting to avoid collisions with planets when you need to move from one planet to another using an interplanetary spaceship.  Rolleyes
Reply
#4
You can add a background static star dome, sun and planet images - I'm sure you can find more online, but I already have uploaded from a space game I created (3DEarth, 3DJupiter and 3DMercury), image uploads : https://litdev.uk/game_images/upload.php

In a better code than below probably best to check if the files are already downloaded, so they only need to be downloaded once.  This is just a simple stub code.

Code:
view = LD3DView.AddView(GraphicsWindow.Width, GraphicsWindow.Height, "False")
LD3DView.MoveCamera(view, 0, 0, 0, -100)
LD3DView.AddAmbientLight(view, "Gray")
LD3DView.AutoControl("False","True",100,1)

skyDomeName = "3DStarDome.jpg"
skyDomeImage = Program.Directory+"/"+skyDomeName
skyDomeURL = "https://litdev.uk/game_images/uploads/"+skyDomeName
LDNetwork.DownloadFile(skyDomeImage,skyDomeURL)
skydome = LD3DView.AddSphere(view, 1000, 24, "Black","E")
LD3DView.AddImage(view, skydome, "", skyDomeImage,"E")
LD3DView.ReverseNormals(view,skydome)

sunName = "3Dsun.jpg"
sunImage = Program.Directory+"/"+sunName
sunURL = "https://litdev.uk/game_images/uploads/"+sunName
LDNetwork.DownloadFile(sunImage,sunURL)
sun = LD3DView.AddSphere(view, 10, 20, "Black", "E")
LD3DView.AddImage(view, sun, "", sunImage, "E")
[-] The following 2 users Like litdev's post:
  • AbsoluteBeginner, Scout
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)