https://codepen.io/etwas-deutsch/pen/MWZdjBo?editors=1000
here is the updated version
https://codepen.io/etwas-deutsch/pen/MWZdjBo?editors=1000
here is the updated version
For further actions, you may consider blocking this person and/or reporting abuse
Harmandeep Singh -
nedajahanfar -
Mofajjal Rasul -
Avesh -
Top comments (6)
Yeah, I like it. But you could improve it by using requestAnimationFrame instead of setInterval because it is much more precise and even handles frame drops. That way it will look smoother.
GrΓΌΓe aus Rostock ;)
thank you i will code that in a bit
so i just going to get rid of the javascript and just make it an HTML so ja that's going to happen
also um any other suggestions
I think another cool thing would be to attach something like a moon to the planet that is orbiting the sun and let that moon orbit the planet. That way it will look like a planetary system. You could achieve this by creating position objects that hold x and y values and reference the position object of planet as anchor in moon. Because objects in javascript are passed by reference, you can then change the position of planet each frame (wich also changes the moon anchor because it is referencing the same object)
Take a look at this jsfiddle i made :)
Orbit Demo
That is a good idea also the is really cool