Alternative to linearImpulse, and checking for iPod

Hello,

As I spoke of in a recent post, you may recall my issue.
In my game you press a button, it calls box:applyLinearImpulse(0, impulseUp, box.x, box.y)

Now my issue is that sometimes it doubles the amount it should. The impulseUp value is -1.8. In the simulator when I was developing, it was -0.9 with the same effect. When I switched to device, I had to double it to get the same effect, which is something that is beyond me.

How can I get an even upward force? I was referred to applyLinearVelocity() which I don’t believe exists, I couldn’t find it in docs or through lua reflection. Is there a better way? It is rather annoying, as sometimes it goes WAY up or not at all.

Second, iPhone/iPod 5. Right now this is my config file

isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight \> 960 )  
   
if isTall then  
   
 application =   
 {  
 content =  
 {  
 width = 320,  
 height = 568,  
 scale = "letterbox",  
 xAlign = "center",  
 yAlign = "center",  
 imageSuffix =   
 {  
 ["@2x"] = 1.5,  
 ["@4x"] = 3.0,  
 },  
 },  
 LevelHelperSettings =   
 {  
 imagesSubfolder = "Images",  
 levelsSubfolder = "Levels"  
 }  
}  

Now it seems to work well in the simulator, but I have reports of it not working on iPod 5. I haven’t been able to track down an actual iPhone 5 to see if it works, but am getting on that ASAP. Is there a different way to check for iPod? How about iPad? If I wanted to do a build for ipad only, how can I check for that?

And I guess lastly, with Peach’s departure, so went the tutorials. The one that in particular I miss, is the “How to add a Rate it Button” and I was wondering if there was another reference to doing this?

Ryley [import]uid: 28237 topic_id: 34501 reply_id: 334501[/import]

I seem to remember posting that the function you want is either setLinearVelocity or applyForce - my first entry was a typo.

I suspect that your required force value is double because your visual area is different in the sim than it is on device. Are you using the same device in the sim as you have in your hand? Have you tried building for XCode sim?

There was a blog post in December by Rob about writing the best config file:
http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

For a rate it button search the Code Exchange - there’s more than one:
http://developer.coronalabs.com/code/corona-sdk-tutorial-rate-me-popup-xcode-console [import]uid: 8271 topic_id: 34501 reply_id: 137227[/import]

There is a lot of good stuff to be gleened from that tutorial in the code exchange, however it’s a bit dated. To actually rate an app, look at the

native. showPopUp()

API call. CraftyDemo’s code for counting when you should show the popup is still valid but this api call replaces the system.openURL() call for rating things and if you plan publish to Barnes and Noble for the Nook they will want you to use this new API.

Thanks @horacebury! Great post!
[import]uid: 199310 topic_id: 34501 reply_id: 137273[/import]

[text]I suspect that your required force value is double because your visual area is different in the sim than it is on device. Are you using the same device in the sim as you have in your hand? Have you tried building for XCode sim?[/text]

Yes, I have. Same effect. I need -0.9 in the Corona simulator, but I need -1.8 in the Xcode simulator or device. Sometimes on the device it doubles the force as it should have already been, so I am looking for something that could be a little more “reliable”

As quoted:
[text] Remember that applying an impulse in any direction will be negated by any velocity in the opposite direction… so if your character is falling and you apply an impulse, it probably won’t do much. If you need a more constant jump height, I suggest you experiment with applyLinearVelocity() instead, which sets a dedicated velocity while cancelling out any offsetting velocities.[/text]

@Rob Miracle, thank you very much, looking into it. Also a big thank you for your .JSON library saving tool, has kept it very simple for me
[import]uid: 28237 topic_id: 34501 reply_id: 137369[/import]

I seem to remember posting that the function you want is either setLinearVelocity or applyForce - my first entry was a typo.

I suspect that your required force value is double because your visual area is different in the sim than it is on device. Are you using the same device in the sim as you have in your hand? Have you tried building for XCode sim?

There was a blog post in December by Rob about writing the best config file:
http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

For a rate it button search the Code Exchange - there’s more than one:
http://developer.coronalabs.com/code/corona-sdk-tutorial-rate-me-popup-xcode-console [import]uid: 8271 topic_id: 34501 reply_id: 137227[/import]

There is a lot of good stuff to be gleened from that tutorial in the code exchange, however it’s a bit dated. To actually rate an app, look at the

native. showPopUp()

API call. CraftyDemo’s code for counting when you should show the popup is still valid but this api call replaces the system.openURL() call for rating things and if you plan publish to Barnes and Noble for the Nook they will want you to use this new API.

Thanks @horacebury! Great post!
[import]uid: 199310 topic_id: 34501 reply_id: 137273[/import]

[text]I suspect that your required force value is double because your visual area is different in the sim than it is on device. Are you using the same device in the sim as you have in your hand? Have you tried building for XCode sim?[/text]

Yes, I have. Same effect. I need -0.9 in the Corona simulator, but I need -1.8 in the Xcode simulator or device. Sometimes on the device it doubles the force as it should have already been, so I am looking for something that could be a little more “reliable”

As quoted:
[text] Remember that applying an impulse in any direction will be negated by any velocity in the opposite direction… so if your character is falling and you apply an impulse, it probably won’t do much. If you need a more constant jump height, I suggest you experiment with applyLinearVelocity() instead, which sets a dedicated velocity while cancelling out any offsetting velocities.[/text]

@Rob Miracle, thank you very much, looking into it. Also a big thank you for your .JSON library saving tool, has kept it very simple for me
[import]uid: 28237 topic_id: 34501 reply_id: 137369[/import]