Store in tinydb a list of coordinates from the ball movement

its possible to store the movement of a ball in tinydb getting the x,y coordinates and next. reproduce this movement stored in tinydb ?.

Yes, use a list of pairs (x,y).

To replay, use a clock timer and run down the list.

No, I will not code this for you.

1 Like

i am stuck how can stored using the timer? can you give me some hint?

1 Like

i know that you need to assign a tag name but how can i make to automatic assign every tag for every x and y value from ball

1 Like

why do you need a different tag each time? why not use the same tag where the value is the list of coordinates? (the global list coodenadas). so, when later you want to recover the list of coordinates, you only have to recover one tag, with the list of al the coordinates.

1 Like

If you want to store the timing of the Ball movements, Clock1.SystemTime makes a wonderful tag for a single observation (x,y)

1 Like

because i know that the tag only save 1 value for tag, bit i ' ll try your suggestion

1 Like

No, the tinydb tag can also store a list.

1 Like

Storing the Ball x,y:

set local variable myRoute to TinyDB tag 'MYBALLROUTE' value default (create empty list)
add item (make a list (Ball1.X, Ball1.Y)) to list myRoute
store local variable myRoute to TinyDB tag 'MYBALLROUTE'

1 Like

i have a problem when i try to play the tag values stored from tinydb. i dont know why is my error but dont reproduce every list of coordinates x,y stored in tinydb

proyectoanimacion.aia (3.7 KB)

1 Like

Ball1.MoveToPoint does not accept a list of points.

See its tool tip.

1 Like

how can set to the ball the tag values stored? please help or some hints

maybe using select item from the list of tinydb?. but how can make that to reproduce the all values x using select item of the list?. maybe using other timer? or its no neccesary using other timer for reproduce the list tagc tinydb ?

proyectoanimacion (1).aia (4.3 KB)

You need a second clock Timer for playing, in addition to the Clock Timer you use for recording.

How can get a list values in index from tinydb to use in timer

hi how can get all the values of a list tinydb [x,y]. i only get all values x and use in a timer calling this value x inside a timer?

See Store in tinydb a list of coordinates from the ball movement - #14 by ABG