In this program, I started learning the basic flow of the Windows Forms program. I did some event handling and some graphics, learned some more stuff that C# makes retarded easy (the List
Swarm() calculates the center position of the collection of bodies and everybody accelerates towards that position. Gravitate() attracts the bodies to one another by (something resembling) gravity. This is all, of course, 2D.
Things I'd like to add:
Hitting tab to center on a body doesn't properly work. I need to fix that. - Once that works, I'd like to be able to double click on a position to center on that point.
- There is no consequence of collisons--gravity simply turns off when the bodies are about to touch (to keep them both from rocketing off into space).
- It'd be nice to put in a menu to add / delete planetary bodies.
- It'd be nice to put in controls to drive around one of the planets.
Here's the source file.
No comments:
Post a Comment