VeltoKit is an experimental Swift framework that maps BLE cap IMU + button packets into a single GameInput struct each frame. gametriki is the reference iOS sample (Pong, Dart, Bowling, Quiz) that exercises the SDK without importing CoreBluetooth in game code.
Disclaimer: Independent project for education and development. Not affiliated with, endorsed by, or connected to any hardware manufacturer or brand.
MotionSDK—connect()+pollInput()→GameInput(orenqueueBLE+updateFramewith your own BLE)MotionMode—.paddle·.pointer·.gesturewithMotionConfig.preset(for:)- Optional
Platform/—TrikiInputAdapter(calibration UI; forwards toMotionSDK) - Sample games — integration tests in
app/Games/ - Documentation — Docusaurus site in
website/(English; Google Translate in navbar) - SPM & CocoaPods —
Package.swift+VeltoKit.podspec(iOS 16+)
Swift Package Manager — in Xcode: Add Package Dependencies → https://github.com/koderhack/veltokit → product VeltoKit.
CocoaPods — pod 'VeltoKit', '~> 0.1.0'
Details: installation docs · VeltoKit/README.md
import VeltoKit
letmotion=MotionSDK()
motion.setMode(.paddle)
motion.connect()func onFrame(dt:TimeInterval){letinput= motion.pollInput(deltaTime: dt)
paddle.x =CGFloat(input.posX)* courtWidth
}import VeltoKit
letadapter=TrikiInputAdapter()
adapter.connect()GameManager.applyMotionMode(gameType:.pong, to: adapter)func tick(dt:TimeInterval){letinput= adapter.pollInput(deltaTime: dt)
// same GameInput fields
}| Game | MotionMode in sample | Main GameInput fields | Source |
|---|---|---|---|
| Pong | .paddle | posX, didShoot | app/Games/PongGame.swift |
| Dart | .pointer + throw FSM | posX, posY, sensors | app/Games/DartGame.swift |
| Bowling | .gesture | posX, shotTriggered, throwPower | app/Games/BowlingGame.swift |
| Quiz | .paddle | posX, primaryAction | app/Games/QuizGame.swift |
Presets and per-game tuning: app/Engine/GameManager.swift.
If the model confuses VeltoKit vs gametriki or invents APIs, point it at:
| Resource | Location |
|---|---|
| AGENTS.md | Repo root — read this first |
| Context for AI | website/docs/ai-context.mdx |
| Cursor skill | .cursor/skills/veltokit/SKILL.md (tracked in repo) |
| Triki menu + calibration | Triki UI docs · Quiz: app/UI/Quiz/QuizFlowView.swift |
| Download prompts | For Cursor Claude |
Ground truth for game code: VeltoKit/GameInput.swift and VeltoKit/MotionSDK.swift.
| Site | https://koderhack.github.io/veltokit/ |
| Docs | https://koderhack.github.io/veltokit/docs/intro |
| AI context | https://koderhack.github.io/veltokit/docs/ai-context |
English source docs; use Translate in the navbar for other languages (Google Translate). Search in the docs navbar: ⌘K / Ctrl+K.
cd website && npm install && npm run startVeltoKit/ MotionSDK.connect(), BLEManager, GameInput (link this target)
app/ Sample iOS app (open app/gametriki.xcodeproj)
Platform/ TrikiInputAdapter (optional calibration UI)
Engine/ GameEngine, GameManager
Games/ Pong, Dart, Bowling, Quiz
UI/ SwiftUI screens
website/ Docusaurus docs (EN + Google Translate)
See also VeltoKit/README.md.
- iOS 16+, Xcode 15+
- Physical iPhone for real BLE (Simulator: feed mock bytes via
enqueueBLE) - Generic BLE cap-style controller (IMU + button) — packet layout in BLE integration
git clone https://github.com/koderhack/veltokit.git
cd veltokit/app
open gametriki.xcodeprojScheme gametriki → your iPhone → Connect BLE → pick a game from the menu.