Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help with reading a list
- bad_user567
-
Scratcher
12 posts
I need help with reading a list
Hi all, I'm working on a 2d animation software for Windows 10 and Android and I'm creating it in scratch as an online demo and I've made a system to save the current pose of the stick figure in a list. Each sequence of frames (animations) is stored like what's shown below. (Everything in brackets would be replaced with whatever value specified.) F1 = Frame 1, F2 = Frame 2, etc.
Animation List
1. F1
2. (Neck1 X)
3. (Neck1 Y)
4. (Arm-Left-1 X)
5. (Arm-Left-1 Y)
6. (Arm-Left-2 X)
7. (Arm-Left-2 Y)
8. (Arm-Right-1 X)
9. (Arm-Right-1 Y)
10. (lower body X)
11. (lower body Y)
12. F2
(repeat of above)
Each joint (Lower arm, upper body etc) is a sprite and are being connected with the pen. Here's the script that connects all joints. (Running in a forever loop + run without screen refresh)

I'm trying to make a script to read this list and for each joint to glide 0.2 seconds to the position specified in the list in frame 1. Then do the same for frame 2, 3, 4 and so on. I've tried but failed to create this script. Can someone try to code this/these script(s) and post them here? Thanks again.
If you need access to the project, let me know, hopefully this is enough data to create the script. Thanks alot!
Animation List
1. F1
2. (Neck1 X)
3. (Neck1 Y)
4. (Arm-Left-1 X)
5. (Arm-Left-1 Y)
6. (Arm-Left-2 X)
7. (Arm-Left-2 Y)
8. (Arm-Right-1 X)
9. (Arm-Right-1 Y)
10. (lower body X)
11. (lower body Y)
12. F2
(repeat of above)
Each joint (Lower arm, upper body etc) is a sprite and are being connected with the pen. Here's the script that connects all joints. (Running in a forever loop + run without screen refresh)

I'm trying to make a script to read this list and for each joint to glide 0.2 seconds to the position specified in the list in frame 1. Then do the same for frame 2, 3, 4 and so on. I've tried but failed to create this script. Can someone try to code this/these script(s) and post them here? Thanks again.
If you need access to the project, let me know, hopefully this is enough data to create the script. Thanks alot!
Last edited by bad_user567 (May 10, 2021 19:37:41)
- bad_user567
-
Scratcher
12 posts
I need help with reading a list
Just realised I made a few mistakes in the list example, sorry. I'll share the correct example later.
- bad_user567
-
Scratcher
12 posts
I need help with reading a list
The thread above has been edited to say the correct info now 

Last edited by bad_user567 (May 10, 2021 19:39:58)
- Discussion Forums
- » Help with Scripts
-
» I need help with reading a list
