One thing that was missing was emitting repeated signals if a button was held down for a longer time. Similar to how your spacebar behaves in a text e

Game development for Apple platforms

submited by
Style Pass
2021-07-04 21:30:02

One thing that was missing was emitting repeated signals if a button was held down for a longer time. Similar to how your spacebar behaves in a text editing program. For example, if you press and hold it, you might expect this behavior:

I.e., you would receive an initial signal, followed by a short delay. After this delay - if you are still holding the space bar - you would start receiving signals in rapid succession.

As a side note, I wanted to mention that I did the initial prototype in Swift Playgrounds on an iPad. I was very tired and didn't feel like working at the computer. So I lounged on the couch, put on Bob's Burgers in the background, and fired up Swift Playgrounds.

It let me have a UIKit button (to send the raw input signal) and play with Combine in the left pane, to see how to achieve the desired effect.

When using the DPAD on a game controller, if you want to switch directions, you would likely release the currently-pressed direction, and then press a new direction. Thus you would receive these events:

Leave a Comment