Moving a object to the right for example I can simply do X=X+1 kinda thing. But there are effects where the object moves really fast for maybe 80% like X=X+10, but then incrementally slows down to a stop.

There is also another effect which has a kind of "rubber bounce" at the end, where it overshoots the stop position slows down and moved back to the left a few pixels. I guess the demo coders may know of this effect and how possibly to do it?

I am sure I did this in STOS like 25 years ago.. and it was using SIN/COS in the mix to get the full effect.. But I don't remember anything about it now I guess as a last resort I could just manually type in a table of numbers to do the effect.

## Moving objects with incremental slowdown..

**Moderator:** troed

- exxos
- Site Admin
**Posts:**12604**Joined:**Wed Aug 16, 2017 11:19 pm**Location:**UK**YouTube:**https://www.youtube.com/user/exxosuk-
**Contact:**

### Moving objects with incremental slowdown..

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS

https://www.exxoshost.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.

https://www.exxoshost.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.

### Re: Moving objects with incremental slowdown..

Table of numbers is how I used to do my sine scrollers etc.

If it ain't broke, test it to Destruction.

### Re: Moving objects with incremental slowdown..

Yup, just use a 1D array of some nice function (can be sin, cos, log, whatever you prefer/looks nice but sin is probably the easiest way).

So the first effect is easy, start at sin(90) = 1 and decrement the angle (index) to 0 (or increment to 180, same thing) which will produce smaller numbers (increases to X in your case). Of course, it's much easier to precalculate the whole thing, i.e. have the final "X" in your table for each increment.

For the bounce effect, that's easy, just don't end up with sin(0) directly on the border but, with, say, sin(5) so the last indices (4, 3, 2, 1, 0) would fall behind the border. Then wrap your sine curve and start counting backwards the same amount (5 indices in my example), putting it back to the border.

So the first effect is easy, start at sin(90) = 1 and decrement the angle (index) to 0 (or increment to 180, same thing) which will produce smaller numbers (increases to X in your case). Of course, it's much easier to precalculate the whole thing, i.e. have the final "X" in your table for each increment.

For the bounce effect, that's easy, just don't end up with sin(0) directly on the border but, with, say, sin(5) so the last indices (4, 3, 2, 1, 0) would fall behind the border. Then wrap your sine curve and start counting backwards the same amount (5 indices in my example), putting it back to the border.