Someone had to do it 馃憖

https://github.com/finnvoor/PlaydateKit

GitHub - finnvoor/PlaydateKit: Create games for Playdate using Swift.

Create games for Playdate using Swift. Contribute to finnvoor/PlaydateKit development by creating an account on GitHub.

GitHub
PlaydateKit now has wrapper types that automatically handle memory management for most of the types returned from the C API, meaning you should (almost) never have to interact directly with the C API / pointers.
and now there's PlaydateGame, a protocol similar to UIApplicationDelegate that receives game lifecycle events
Going back and forth on whether PlaydateKit docs should use DocC Tutorials or Articles... It's really nice to have images that update with each step when using a Tutorial, but it's much easier to scroll around / quickly get an overview with an Article, much more like a blog post.

PlaydateKit now has step-by-step instructions on getting started building and running a game on the Playdate simulator using Swift

https://finnvoor.github.io/PlaydateKit/documentation/playdatekit

Documentation

Turns out this project is a great way to find bugs in the nightly Swift compiler

https://github.com/apple/swift/issues/72502
https://github.com/apple/swift/issues/72531

swift_deallocPartialClassInstance: Cannot early return from class init 路 Issue #72502 路 apple/swift

Description Using an early exit causes a linker failure in embedded swift https://swift.godbolt.org/z/33EqW6crh Reproduction struct FooError: Error {} class Foo { var x: Int var y: Int init(a: Bool...

GitHub
PlaydateKit just got swiftier. Instead of setting update callbacks and getting OpaquePointers, you can now just subclass Sprite and override the update/collisionResponse functions.

Following some nice bug fixes to Embedded Swift, PlaydateKit has some new features:

- All the APIs now use Strings instead of cstrings/StaticStrings
- Log to the console directly using Swift's built in print()

Never a better time to give it a try:
https://github.com/finnvoor/PlaydateKit
#playdate

GitHub - finnvoor/PlaydateKit: Create games for Playdate using Swift.

Create games for Playdate using Swift. Contribute to finnvoor/PlaydateKit development by creating an account on GitHub.

GitHub
Unfortunately it seems like autocomplete when using PlaydateKit has completely stopped working in Xcode 16, probably due to the complicated package setup

Working on a lil Pong example for PlaydateKit, great way to find missing features / improvements needed for actually creating games.

#playdate #EmbeddedSwift

Open challenge to anyone interested:

Make a better computer player for my Pong example, so that it's actually fun to play against. Right now it doesn't really know how to play Pong at all.

Relevent code: https://github.com/finnvoor/PlaydateKit/blob/082d8ab20a4353a5849bb571a38db0d2f0693d12/Examples/Pong/Sources/Pong/Game.swift#L164-L183

#playdate

PlaydateKit/Examples/Pong/Sources/Pong/Game.swift at 082d8ab20a4353a5849bb571a38db0d2f0693d12 路 finnvoor/PlaydateKit

Create games for Playdate using Swift. Contribute to finnvoor/PlaydateKit development by creating an account on GitHub.

GitHub

This weekend I made a Flappy Bird clone with PlaydateKit. Fixed a few bugs and added easing functions while doing it, but it exposed some areas where PlaydateKit needs some work:
- timers
- grid view
- text alignment
- more geometry utils

A scene manager / ECS system would also be nice, but probably beyond the scope of this repo.

#playdate #EmbeddedSwift

Go play Flappy Swift in person at #githubuniverse!

huge thanks to @paris and @rauhul for setting this up

https://hachyderm.io/@paris/113397131109075659

paris :1up: (@paris@hachyderm.io)

Attached: 2 images #githubuniverse attendees! The Swift crew is here and ready to talk you about Swift 6, linux, windows, community, and everything in between! trick or treat!! come play flappy swift on the play date thanks to @finnvoorhees@mastodon.social and win prizes!! #swiftlang #opensource

Hachyderm.io

PlaydateKit now has two big new features thanks to Dustin Collins:
https://github.com/finnvoor/PlaydateKit/pull/106

- Full unicode data table support: Use string dictionary keys, string comparisons, count/uppercased/split/etc.

- Multiple levels of dependencies: the build system now handles dependencies recursively, allowing you to, e.g., create a game engine package that depends on PlaydateKit and use it within your game.

#playdate #EmbeddedSwift

Swift 6, SwiftUnicodeDataTables, Other Improvements by STREGA 路 Pull Request #106 路 finnvoor/PlaydateKit

Reworked PDCPlugin so PlaydateKit and CPlaydate are built as part of the product dependencies Added simple support for C/C++ modules. Since the PDCPlugin cannot access the Package cSettings/cxxSett...

GitHub

鈿欙笍 I've just merged a big change to the PlaydateKit build system. It now uses the SwiftPM build system for almost all of the build as opposed to a bunch of fragile individual commands and flags. This means:
- 1.5x faster clean builds
- 9x faster incremental builds
- Much more stable linux builds
- Possibly Windows support soon?

The embedded Swift team has been making tons of improvements, it's easier than ever to get started with #EmbeddedSwift on #Playdate!

https://finnvoor.github.io/PlaydateKit/documentation/playdatekit/

Documentation

PlaydateKit now includes an xkcd reader example, thanks to @paul!
It鈥檚 a great demo of the Playdate networking APIs and shows how you can integrate C libraries for things like QR code generation and PNG decoding with Swift鈥檚 C interop.

https://github.com/finnvoor/PlaydateKit/tree/main/Examples/Xkpd

also available on itch:

https://paulstraw.itch.io/xkpd

#playdate #EmbeddedSwift