Posts

Post not yet marked as solved
0 Replies
339 Views
I need to associate sound with the movement of a sprite. Movement can be as a result of physics, not as a result of an SKAction. When the object is sliding thee should be sliding sound throughout the time when it is sliding, and then a different sound when it bumps into a rock and goes up in the air. When the object is airborne, there is no sound, till it falls again - a falling sound, and then slides down with a sliding sound. The sounds associated with the collision ( rock, ground and so on ) are straightforward and work fine. But am having difficulty associating the sound with movement. The closest result I have is to check the velocity of the sprite's physics body every update cycle and play or stop the sound based on whether the velocity is greater than zero. I tried SKAction.playSoundFileNamed first - the sound kept going even when the object was not moving. I tried adding an SKAudioNode with Play and Stop, with no better result. I finally tried using AVAudioPlayer to play and Pause , which yielded the best results, but the sliding sound still played past the sliding action. What is the best way to do this? My code for playing the sound is as follows: var blockSliding = false for block in gameBlocks { if (block.physicsBody?.velocity.dx ?? 0) + (ball.physicsBody?.velocity.dy ?? 0) > 0.05 { blockSliding = true break } } if slideSound.isPlaying { if !blockSliding { slideSound.pause() } } else { if blockSliding { slideSound.play() } } I have setup slideSound earlier loading the appropriate sound file into an AVAudioPlayer
Posted Last updated
.
Post not yet marked as solved
0 Replies
564 Views
I am developing many products and services to help children learn to speak Tamil as a second language. As part of this platform, I am publishing illustrated children's books that are distributed via Amazon as well as from my website. I am developing a companion reader app for an interactive digital version on the iPad. The books will be narrated on demand, and children will be able to click on words and images to hear Tamil being spoken. I am creating this content for the printed and digital versions. I am writing new stories, and am working with authors/publishers to adapt/translate their existing books for use in this platform. When the app is first installed, the content for one free book is downloaded for the user, so that there is a book to try the app. Additional books can be purchased individually or as 'packs'. I apologize if this background seems excessive, but I want to set the stage for my questions. 1. Customers can buy printed and digital books. Can I put in information about how they can buy the printed book in my app? 2. Does all purchasing content have to happen outside the app, or can I have new books(digital version) bought both as in-app purchases and as direct purchases outside the app? This is important, as I want to provide hard copy buyers the ability to get free or discounted access to the digital version - and this can be done when they buy the books from my website. At the same time, I want to provide an easy means for the user to buy content via in-App purchase if they want.
Posted Last updated
.