you missed one comma after this line
[lua]UIApplicationExitsOnSuspend = true[/lua] [import]uid: 71210 topic_id: 12870 reply_id: 47937[/import]
Funny how the smallest comma can make a difference. That worked, thanks [import]uid: 59140 topic_id: 12870 reply_id: 47938[/import]
Well there are a few ways to go about this. You could do something as simple as setting gravity to 0 or you could change the apple’s physics body type from “dynamic” to “static” (since static objects don’t move) or “kinematic” (since kinematic objects will not respond to gravity). How to display a results screen will depend on if you’re using director or not. [import]uid: 27965 topic_id: 12870 reply_id: 47940[/import]
Awesome I’ve got all that working! I should be able to just make the results screen happen after the apples have fallen and just make a second or two pause before the screen comes up. [import]uid: 59140 topic_id: 12870 reply_id: 48089[/import]
Looks like I spoke too soon.
I put the version that was supposed to stop the apples from falling onto my iPod but the apples kept falling. I looked in the terminal and got this error
Runtime error
…kilkenny/Desktop/Today’s Tutorials/acc_ball/main.lua:116: bad argument #-1 to ‘addBody’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘addBody’
…kilkenny/Desktop/Today’s Tutorials/acc_ball/main.lua:116: in function ‘noMoreApples’
…kilkenny/Desktop/Today’s Tutorials/acc_ball/main.lua:122: in function ‘_listener’
?: in function <?:446>
?: in function <?:215>
Any Ideas? I tried stoping the physics which worked but it left the apple frozen on the screen. Could I move it off the screen with out it making multiple copies every time a user replays? If I can what would I type in?
Danny
EDIT
Oh and this is the code
[code]
local noMoreApples = function()
physics.addBody(apple, “kinematic”)
end [import]uid: 59140 topic_id: 12870 reply_id: 48472[/import]
The code you posted isn’t actually changing the physics body type of the apple object, it’s trying to add another physics body (which is probably the reason for the error). To change the body type of an object use object.bodyType = “kinematic” so your noMoreApples function should look like this:[lua]local noMoreApples = function()
apple.bodyType = “kinematic”
end[/lua] [import]uid: 27965 topic_id: 12870 reply_id: 48479[/import]
Ok I see what you’re saying and that got rid of the error which is awesome. The only thing is it doesn’t stop the spawn apples function. Is there a way to basically tell the function to stop? [import]uid: 59140 topic_id: 12870 reply_id: 48484[/import]
Inside the spawnApple function you have an if statement to check how many apples have been spawned. If you add the line “return true” (without the quotes) after the noMoreApples function is called then the spawnApple function should stop running. [import]uid: 27965 topic_id: 12870 reply_id: 48487[/import]
Thank you so much! It doesn’t have any errors and is working great. Thank you also for coming back to my questions (which can be a lot as you know
and sticking with them till they were figured out. I’d love to send you a copy of my game when it’s finished. If you’d like to send me your email I will send out a code when it’s ready but if not that’s fine just let me know. I’ll post my email if you want to.
Danny [import]uid: 59140 topic_id: 12870 reply_id: 48489[/import]
Thanks for the gratitude! I don’t have an iOS device so unless you release your game on Android I won’t be able to play it. You can send me a link to your game if that is the case and I might just buy it to show my support. My email is calebdev2048@gmail.com. Personally I’d rather you help out on the forums when you can as that would benefit the community as whole rather than just me. [import]uid: 27965 topic_id: 12870 reply_id: 48500[/import]
Yeah I’m aiming more for iOS as of now but I would like to branch out to android and some point. Believe me I love helping people when I can. I’m new so my knowledge of lua isn’t great but I like helping out on the new users form cause they’re easy to solve. [import]uid: 59140 topic_id: 12870 reply_id: 48507[/import]
Well if you need a play tester for Android I have a Samsung Galaxy S (Fascinate) and my wife has a Droid X to test on. [import]uid: 27965 topic_id: 12870 reply_id: 48509[/import]