Arrays are done so that the first value is position 0, so, x - 0 and y - 1.
An example:
Scene.my.a = [1, 2, 3,]
Reading: scene.my.a(0) = 1
Reading: scene.my.a(1) = 2
For your specific example, it would be velocity(0)
The code would look something like this: scene.my.velX = velocity(0).
Unfortunately, you can only read an array element using an index. You cannot write to a single array element. For example, you CANNOT do velocity(0) = scene.my.velX. Many of us Thyme scripters have been begging for this fix for a long time, but it seems to fall on deaf ears.
And pos(0) and pos(1) are saying x position and y position.
Ex:
pos=[5,13]
pos(0)=5
pos(1)=13
An example:
Scene.my.a = [1, 2, 3,]
Reading: scene.my.a(0) = 1
Reading: scene.my.a(1) = 2
For your specific example, it would be velocity(0)
The code would look something like this: scene.my.velX = velocity(0).
Unfortunately, you can only read an array element using an index. You cannot write to a single array element. For example, you CANNOT do velocity(0) = scene.my.velX. Many of us Thyme scripters have been begging for this fix for a long time, but it seems to fall on deaf ears.
And pos(0) and pos(1) are saying x position and y position.
Ex:
pos=[5,13]
pos(0)=5
pos(1)=13
Re: Arrays
Dream of Algodoo as game development engine...
Kilinich- [Best bug reporter 2010]
- Posts: 1502
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
No hay comentarios:
Publicar un comentario