Animation moving from top to bottom

Excuse me, I am a beginner of MIDP game programming.
If I want to produce an animation which only moves an image from left to right and move 1 per time, how should I do?
Thanks

Its quite easy but before you delve too deep I suggest you figure out what it is your trying to achieve. You will have to use a Thread or TimerTask object to move the object every couple of milliseconds or seconds, or game ticks. And then increase/decrease the x coordinate of the sprite, using either setPosition or moveBy.

I highly recommend you have search through these forums and do some research as someone will have some sample code lieing around.

Amin

I almost wrote a sample, then went looking as ameano recommended. There are good samples that come with the sun wireless toolkit j2mewtk: http://java.sun.com/products/j2mewtoolkit/download-2_2.html

One of them is under games, called worm. The other is under demos called ManyBalls. Both of these do what you are looking for. If you want to post specific questions about the code on any of those I’m sure many around here like me would be happy to answer them.

Wood