Orbital motion caused by gravity is elliptic (or parabolic or hyperbolic). The Cartesian and polar equations for ellipses can be parametrized, and animated. Such an animation will not look like a planet orbiting a star because it needs to move faster near the star, which is at a focus of the ellipse. In order to make a parametrization based on time, Kepler's equation M = E - esin(E) has to be solved for E given M. E cannot simply be made the subject of this equation, so numerical methods must be used.
Ellipses can be characterised by two constants, a and e. These are somewhat like the radius and a squashing factor. In fact a is the 'semi-major axis' (the longer 'radius'), and a√(1 - e2) is the 'semi-minor axis' (the shorter 'radius'). The value of e is between 0 (a circle) and 1 (a parabola).
This animation begins with the planet at the furthest point from the star. 2000 positions are calculated. Each position involves solving Kepler's equation using simple secondary school numerical methods, and then calculating x and y coordinates from polar coordinates. The animation is done using javascript and svg.
The article in Wikipedia here is very good for more information about elliptic orbits and Kepler's equation.
You can see the source code of this page by right-clicking. It does not need to be run from a server, but can be saved as whatever.html on your own computer. Unfortunately svg combined with javascript calculations only works easily on Chrome, as far as I know.