Skip to content

Repository files navigation

VeltoKit

DocsiOS 16+SwiftBLE unofficial

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.

Features

  • MotionSDKconnect() + pollInput()GameInput (or enqueueBLE + updateFrame with your own BLE)
  • MotionMode.paddle · .pointer · .gesture with MotionConfig.preset(for:)
  • Optional Platform/TrikiInputAdapter (calibration UI; forwards to MotionSDK)
  • Sample games — integration tests in app/Games/
  • Documentation — Docusaurus site in website/ (English; Google Translate in navbar)
  • SPM & CocoaPodsPackage.swift + VeltoKit.podspec (iOS 16+)

Install VeltoKit

Swift Package Manager — in Xcode: Add Package Dependencieshttps://github.com/koderhack/veltokit → product VeltoKit.

CocoaPodspod 'VeltoKit', '~> 0.1.0'

Details: installation docs · VeltoKit/README.md

Quick start (SDK only)

import VeltoKit
letmotion=MotionSDK()
motion.setMode(.paddle)
motion.connect()func onFrame(dt:TimeInterval){letinput= motion.pollInput(deltaTime: dt)
paddle.x =CGFloat(input.posX)* courtWidth
}

Quick start (sample app adapter)

import VeltoKit
letadapter=TrikiInputAdapter()
adapter.connect()GameManager.applyMotionMode(gameType:.pong, to: adapter)func tick(dt:TimeInterval){letinput= adapter.pollInput(deltaTime: dt)
// same GameInput fields
}

Sample games → VeltoKit

GameMotionMode in sampleMain GameInput fieldsSource
Pong.paddleposX, didShootapp/Games/PongGame.swift
Dart.pointer + throw FSMposX, posY, sensorsapp/Games/DartGame.swift
Bowling.gestureposX, shotTriggered, throwPowerapp/Games/BowlingGame.swift
Quiz.paddleposX, primaryActionapp/Games/QuizGame.swift

Presets and per-game tuning: app/Engine/GameManager.swift.

For AI assistants (Cursor, Claude, …)

If the model confuses VeltoKit vs gametriki or invents APIs, point it at:

ResourceLocation
AGENTS.mdRepo root — read this first
Context for AIwebsite/docs/ai-context.mdx
Cursor skill.cursor/skills/veltokit/SKILL.md (tracked in repo)
Triki menu + calibrationTriki UI docs · Quiz: app/UI/Quiz/QuizFlowView.swift
Download promptsFor Cursor Claude

Ground truth for game code: VeltoKit/GameInput.swift and VeltoKit/MotionSDK.swift.

Documentation

Sitehttps://koderhack.github.io/veltokit/
Docshttps://koderhack.github.io/veltokit/docs/intro
AI contexthttps://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.

intro · SDK · Pong

cd website && npm install && npm run start

Repository layout

VeltoKit/ 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.

Requirements

  • 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

Clone and run

git clone https://github.com/koderhack/veltokit.git
cd veltokit/app
open gametriki.xcodeproj

Scheme gametriki → your iPhone → Connect BLE → pick a game from the menu.

About

VeltoKit — unofficial Swift SDK: BLE cap IMU → GameInput for iOS games. Sample arcade app (Pong, Dart, Bowling, Quiz)

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages