Move multiple graphical objects
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Move multiple graphical objects
If I have a couple of oval objects on a card in my mainstack and I place the following code in a button also on this card;
on mouseUp
set the lockMoves to true
move graphic "myOval" to random(400),random(400) in random(3) seconds
move graphic "myOval1" to random(400),random(400) in random(3) seconds
set the lockMoves to false
end mouseUp
Why do the oval objects jump from one position to another instead of moving smoothly?
Any way of making multiple objects move slowly and concurrently?
Jeff
on mouseUp
set the lockMoves to true
move graphic "myOval" to random(400),random(400) in random(3) seconds
move graphic "myOval1" to random(400),random(400) in random(3) seconds
set the lockMoves to false
end mouseUp
Why do the oval objects jump from one position to another instead of moving smoothly?
Any way of making multiple objects move slowly and concurrently?
Jeff
Chat with other RunRev developers, pop over to www.bjoernke.com/runrev/chatrev.php
Hi Jeff, my guess is that using lockMoves is causing the prob. Take the lockMove true and false out of the equation and it works OK.
Still leaves the problem of running at the same time. I would think you need something like the code below:
Still leaves your problem of moving it over the time period; I'm a bit tired and pushed for time to work it out at the moment but I'm certain someone else will gladly supply this addition to the above code (if they think it's the correct way to go about this!
)
Hope I've been of some help...

Still leaves the problem of running at the same time. I would think you need something like the code below:
Code: Select all
on mouseUp pMouseBtnNo
hereWeGo
end mouseUp
on hereWeGo
put random(400) into tUp
put random(400) into tLeft
put random(3) into tSecs
set the location of graphic "MyOval" to tUp, tLeft --in tSecs seconds
put random(400) into tUp
put random(400) into tLeft
put random(3) into tSecs
set the location of graphic "MyOval1" to tUp, tLeft --in tSecs seconds
send hereWeGo to me in 120 milliseconds
end hereWeGo

Hope I've been of some help...

Hi Jeff,
This works for me, the trick is the without waiting
cheers
bernd
Code: Select all
on mouseUp
set the lockmoves to true
move graphic "myOval" to random(400),random(400) in random(3) seconds without waiting
move graphic "myOval1" to random(400),random(400) in random(3) seconds without waiting
set the lockmoves to false
end mouseUp
cheers
bernd
Jeff,
I've learned from Bernard here as well, excellent. If it's OK, I wish to ask Bernard a couple of questions via your thread....
Hi Bernard
I tried a second button to move a third object; clicking one straight after the other, I was really pleased to see that they all moved at the same time.
So this would seem to be a suitable and perfectly reasonable substitute for a type code
Is that correct? Could I activate say, 30 graphics at the same time from multiple handlers from different scripts, and they'd all move smoothly at the same time?
And secondly, could one weave in animation using move without waiting i.e loop through 10 frames, for instance, could you tell me, please? (My gut instinct tells me the answer is going to be no but I hope I'm wrong!)

Ah well, I wasn't but I tried!Hope I've been of some help...

Hi Bernard
I tried a second button to move a third object; clicking one straight after the other, I was really pleased to see that they all moved at the same time.
So this would seem to be a suitable and perfectly reasonable substitute for a
Code: Select all
send "SuchandSuch" to me in --so many -- milliseconds
Is that correct? Could I activate say, 30 graphics at the same time from multiple handlers from different scripts, and they'd all move smoothly at the same time?
And secondly, could one weave in animation using move without waiting i.e loop through 10 frames, for instance, could you tell me, please? (My gut instinct tells me the answer is going to be no but I hope I'm wrong!)

Hi Gyroscope,
So for most things you can move quite some number of objects with this and have a nice performance. This is on a mac intel 2.2 GHz, obviously if you use a slower processor it might be less objects. So if you want to start many object with different trajectories and travel time it is a viable way.
But really Malte is the ultimate reference all things Animation.
cheers
Bernd
I do it with up to 30 graphics at the same time, depending what you let them move by it is fairly smooth or in some cases (I let them move along the points of a graphic) if there are many points lets say more than 60 with long distances in between it starts to get jerky.s that correct please? Could I activate say, 30 graphics at the same time, and they'd all move smoothly at the same time?
So for most things you can move quite some number of objects with this and have a nice performance. This is on a mac intel 2.2 GHz, obviously if you use a slower processor it might be less objects. So if you want to start many object with different trajectories and travel time it is a viable way.
But really Malte is the ultimate reference all things Animation.
cheers
Bernd
Thanks for the reply, Bernard. Sounds good, I'll experiment further with move without waiting some time soon.
I wonder if there is any info/practical examples on how to weave in animation code into any of the AE handlers/functions (i.e animation on the move travelling in a circle, or ellipse, for instance), also with info about timing?
Apologies Jeff, if it seems like I'm taking over your thread; thank you.

Yes, he certainly is, I have a copy of the excellent Animation Engine but haven't used it much (um, actually, haven't used it at all yet!) but I will when the muse tells me to jump to my adventure game I hope to write some day.But really Malte is the ultimate reference all things Animation.
I wonder if there is any info/practical examples on how to weave in animation code into any of the AE handlers/functions (i.e animation on the move travelling in a circle, or ellipse, for instance), also with info about timing?
Apologies Jeff, if it seems like I'm taking over your thread; thank you.
