App inventor: How to move sprite as long as button is pressed? - game-development

I recently wanted to develop a Brick Braker game in App inventor. But I keep coming across the same problem again and again. I'm trying to get the sprite to move as long as the button is pressed, so the longer the button is pressed the further the sprite moves, in ten steps. How do I do that? So far i only managed to get the sprite to move 10 pixels with every single click, but it would be stupid if you have to spamm the button all the time.

Related

How can I set background image when half of app screen slides down for the behavior double tap the home button?

I'm finding a way to set a background image when half of app screen slides down. for the behaviour double tap the home button. Can anybody give me some help for this?
That area is not part of the application, but rather a view placed by the operating system.
Think of the double tap as a mechanism for the OS to "shift" your app down for easier access.

Detect iPhone Volume Button Hold? (iOS 8)

Is there a way to detect if any of the volume buttons on the iPhone are being held?
I know you can detect if one has been pressed, but I specifically need to know if one is being held down.
That's not really possible, but you can have an approximation starting a timer every time you get a volume button pressed event, since you'll receive multiple events in succession when the button is hold. If every time you restart the timer, when the button is released the timer will get triggered and you can do whatever you want. 0.5 seconds worked for me.

Objective-c call touch on screen without user touching the screen

Im going to be using a framework that allows a iphone app to control my app on iPad. When i add it im going to make the joystick move a image of a mouse, and when the user presses the A button, i want to make the device think the user is touching at that point. Is there any way to do this?
Example: I place a button on the ipad screen at 0,0 with height and width of 100. then mouse is at point 50,50 and when the user presses and holds A, that button is held down, and when user lifts up, it calls that buttons action.

avaudioplayer-two background music problem

I have two .xibs in my app. The first .xib contains a round rectangle button that opens second .xib. ViewDidLoad method of second .xib starts a background music(mp3 file) using AVAudioPlayer and then shows an animation by running a sequence of images. Now second .xib button has a "back button".
If I click on the back button before animation and audio stops, reach on first xib and click on round rectangle button again then it starts two background music files.
How do I fix it?
Also, how do you stop music if a song is already playing on ipod when app's background music starts?

iPhone SDK: Record time of buttons in a sequence to play back

I've got an app in development where you press a button to play a sound using System beep.
Instead of recording the output, I was thinking of recording the timing of when the buttons were pressed, so when the user presses a 'Play' button, the buttons are pressed in the same timing the user has pressed them, so it acts like the iPhone has recorded the sounds, but it's just playing them in sequence. I'd like this to occur once the user has pressed a Record button.
Example:
User presses record
Timing starts
records timing of each button pressed and when
Timing stops after a button has been pressed
PLay button plays back the sequence of events
Can anybody give any ideas on coding, documents to read etc.
Thanks a lot!
http://pastie.org/376474
This should hopefully help you out a bit.
It works in essence, though I haven't actually tested it, so I'm not positive it works.
I assume you can read through it and find a way to fit it in your own code.
Good luck!
Many system time methods have a way to get the value in seconds since the epoch.
Depending on the granularity of the system clock you can just grab the system time of the start button press and grab the time again when each button is pressed.
To calculate the timing just subtract the start time from the button press time.