I'm an aspiring web developer primarily interested in front-end development. But I also enjoy building backends. Having grown up with computer games, I also enjoy programming browser games.
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.
I'm an aspiring web developer primarily interested in front-end development. But I also enjoy building backends. Having grown up with computer games, I also enjoy programming browser games.
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)
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