Someone else can correct me if I'm wrong, but I believe 300 = 300 pixels/second, so on an iphone screen landscape an object would move across the screen in one second. On an ipad landscape it would take over two seconds (768/300 = 2.56 seconds)
Im not sure if its slower on the ipad, but it could be since there more screen space itll take longer to get somewhere on the ipad at the same speed as on the iphone since theres lest distance between.
Na it really is pixels per second, as calculated by a 480x320 iphone or a 1024x768 ipad. In other words, on an iPhone4 it's doubled, so "300" is 600 pixels/second. I hadn't tested it in a while, but I made a quick demo with the following:
Create a landscape project create an actor and place it at position 0 (x) and any Y position. Give it an X velocity of 100. Add a timer that after 4.6 seconds, change attribute color.red to 0 (or some other indicator)
Now, when you preview, the actor will move across the screen at a rate of 100 pixels per second, and just as it is about to leave the screen (after 4.6 seconds, or 460 pixels) it will change color.
xarmian said: Na it really is pixels per second, as calculated by a 480x320 iphone or a 1024x768 ipad. In other words, on an iPhone4 it's doubled, so "300" is 600 pixels/second. I hadn't tested it in a while, but I made a quick demo with the following:
Create a landscape project create an actor and place it at position 0 (x) and any Y position. Give it an X velocity of 100. Add a timer that after 4.6 seconds, change attribute color.red to 0 (or some other indicator)
Now, when you preview, the actor will move across the screen at a rate of 100 pixels per second, and just as it is about to leave the screen (after 4.6 seconds, or 460 pixels) it will change color.
Same works for an iPad target..
Not when you cut that down. Have an actor move at a speed of 100 for one second. It does not move 100 pixels. That could be the fact that move behavior is inconsistent and your likely to get a different end result every time. Either way i wouldnt count on the move behavior to move an exact pixles per second
And not sure what you mean by iphone 4. Resolution indepence with your images shouldnt have anything to do with the time it takes to move. Your actors the same size and the screen size is the same the image size is just doubled.
also just tested to confirm it. I had a actor move for one second at a speed or 100, had a attribute change to its start x position, had another attribute changed to its end x position, then subtracted the end from the first.
Running on the desktop (regardless of target platform) move and velocity appear to be measured in pixels per second, you can easily check that by comparing with an interpolate. http://gamesalad.com/forums/topic.php?id=22691
Create an actor, place it at position X = 0, Y = 100 Set self.Motion.Linear.X to 100
Create a timer - After (expression): (Device.screen.size.width/100) seconds - change attribute self.Motion.Linear.X to 0
Now, preview it. And after 4.8 seconds on an iphone (landscape), or 10.2 seconds on an iPad (landscape) it'll stop, which will place it at straddling the right-hand margin of the screen.
Of course you're right, about inconsistencies caused by lag or other factors, but as a general rule, this works.
Yeah the value its supposed to be might actual be pixels per second, the inconsistencies just throw it off so often. I can reproduce your test and get the answer you 1 out of 3 times. So i guess the conclusion is its set to pixel per seconds, but to inconsistent to actually depend on it.
Comments
Im not sure if its slower on the ipad, but it could be since there more screen space itll take longer to get somewhere on the ipad at the same speed as on the iphone since theres lest distance between.
Create a landscape project
create an actor and place it at position 0 (x) and any Y position. Give it an X velocity of 100.
Add a timer that after 4.6 seconds, change attribute color.red to 0 (or some other indicator)
Now, when you preview, the actor will move across the screen at a rate of 100 pixels per second, and just as it is about to leave the screen (after 4.6 seconds, or 460 pixels) it will change color.
Same works for an iPad target..
And not sure what you mean by iphone 4. Resolution indepence with your images shouldnt have anything to do with the time it takes to move. Your actors the same size and the screen size is the same the image size is just doubled.
also just tested to confirm it. I had a actor move for one second at a speed or 100, had a attribute change to its start x position, had another attribute changed to its end x position, then subtracted the end from the first.
http://gamesalad.com/forums/topic.php?id=22691
Create an actor, place it at position X = 0, Y = 100
Set self.Motion.Linear.X to 100
Create a timer - After (expression): (Device.screen.size.width/100) seconds
- change attribute self.Motion.Linear.X to 0
Now, preview it. And after 4.8 seconds on an iphone (landscape), or 10.2 seconds on an iPad (landscape) it'll stop, which will place it at straddling the right-hand margin of the screen.
Of course you're right, about inconsistencies caused by lag or other factors, but as a general rule, this works.