Skip to content

koderhack/veltokit

Repository files navigation

VeltoKit

Docs iOS 16+ Swift BLE 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

let motion = MotionSDK()
motion.setMode(.paddle)
motion.connect()

func onFrame(dt: TimeInterval) {
  let input = motion.pollInput(deltaTime: dt)
  paddle.x = CGFloat(input.posX) * courtWidth
}

Quick start (sample app adapter)

import VeltoKit

let adapter = TrikiInputAdapter()
adapter.connect()
GameManager.applyMotionMode(gameType: .pong, to: adapter)

func tick(dt: TimeInterval) {
  let input = adapter.pollInput(deltaTime: dt)
  // same GameInput fields
}

Sample games → VeltoKit

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.

For AI assistants (Cursor, Claude, …)

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.

Documentation

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.

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors