Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assets/AdaEngine.icon/icon.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
],
"squares" : "shared"
}
}
}
4 changes: 2 additions & 2 deletions Demos/Fold/Sources/FoldGame/FoldPose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public struct FoldPose: Resource, Codable, Equatable, Sendable {
@MainActor public static func registerRuntimeType() {
RuntimeTypeRegistry.registerResource(Self.self, names: ["FoldPose"])
RuntimeResourceReflectionRegistry.register(Self.self, fields: ["angle", "showsOuter"].map { key in
unsafe EditorComponentFieldDescriptor(
key: key, label: key, kind: .readOnly, isEditable: false, accepts: { _ in false },
unsafe ReflectedComponentField(
key: key, label: key, kind: .readOnly, isWritable: false, accepts: { _ in false },
read: { _ in nil }, write: { _, _ in nil }, readPointer: { pointer in
let pose = unsafe pointer.assumingMemoryBound(to: Self.self).pointee
return key == "angle" ? .double(Double(pose.playableAngle)) : .bool(pose.showsOuter)
Expand Down
14 changes: 7 additions & 7 deletions Demos/Fold/Sources/FoldGame/ShadowLevel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public struct ShadowPlayerInput: Resource, Sendable {
@MainActor public static func registerRuntimeType() {
RuntimeTypeRegistry.registerResource(Self.self, names: ["ShadowPlayerInput"])
RuntimeResourceReflectionRegistry.register(Self.self, fields: ["moveX", "jump", "flip", "transfer", "restart"].map { key in
unsafe EditorComponentFieldDescriptor(key: key, label: key, kind: key == "moveX" ? .float : .int, isEditable: true,
unsafe ReflectedComponentField(key: key, label: key, kind: key == "moveX" ? .float : .int, isWritable: true,
read: { _ in nil }, write: { _, _ in nil }, readPointer: { pointer in
let value = unsafe pointer.assumingMemoryBound(to: Self.self).pointee
switch key {
Expand All @@ -91,12 +91,12 @@ public struct ShadowPlayerInput: Resource, Sendable {
}
}, writePointer: { pointer, field in
let value = unsafe pointer.assumingMemoryBound(to: Self.self)
if key == "moveX" { return unsafe EditorComponentReflection.write(field, to: &value.pointee.moveX) }
if key == "moveX" { return unsafe ComponentReflection.write(field, to: &value.pointee.moveX) }
switch key {
case "jump": return unsafe EditorComponentReflection.write(field, to: &value.pointee.jump)
case "flip": return unsafe EditorComponentReflection.write(field, to: &value.pointee.flip)
case "transfer": return unsafe EditorComponentReflection.write(field, to: &value.pointee.transfer)
default: return unsafe EditorComponentReflection.write(field, to: &value.pointee.restart)
case "jump": return unsafe ComponentReflection.write(field, to: &value.pointee.jump)
case "flip": return unsafe ComponentReflection.write(field, to: &value.pointee.flip)
case "transfer": return unsafe ComponentReflection.write(field, to: &value.pointee.transfer)
default: return unsafe ComponentReflection.write(field, to: &value.pointee.restart)
}
})
})
Expand All @@ -113,7 +113,7 @@ public struct ShadowProgress: Resource, Sendable {
@MainActor public static func registerRuntimeType() {
RuntimeTypeRegistry.registerResource(Self.self, names: ["ShadowProgress"])
RuntimeResourceReflectionRegistry.register(Self.self, fields: ["checkpoint", "completed", "outer", "message"].map { key in
unsafe EditorComponentFieldDescriptor(key: key, label: key, kind: .readOnly, isEditable: false, accepts: { _ in false },
unsafe ReflectedComponentField(key: key, label: key, kind: .readOnly, isWritable: false, accepts: { _ in false },
read: { _ in nil }, write: { _, _ in nil }, readPointer: { pointer in
let value = unsafe pointer.assumingMemoryBound(to: Self.self).pointee
switch key {
Expand Down
111 changes: 111 additions & 0 deletions Demos/MedievalArena/.ada/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"ai": {
"mcp": {
"allowedResourceRoots": [],
"enabled": true
}
},
"build": {
"excludedFiles": [],
"includedFiles": [],
"system": "adascript",
"targets": []
},
"editor": {
"startupScene": "Assets/Scenes/Main.ascn"
},
"engine": {},
"inputActions": [
{
"bindings": [
{ "key": { "_0": "w" } },
{ "key": { "_0": "126" } }
],
"deadZone": 0.2,
"name": "MoveUp"
},
{
"bindings": [
{ "key": { "_0": "s" } },
{ "key": { "_0": "125" } }
],
"deadZone": 0.2,
"name": "MoveDown"
},
{
"bindings": [
{ "key": { "_0": "a" } },
{ "key": { "_0": "123" } }
],
"deadZone": 0.2,
"name": "MoveLeft"
},
{
"bindings": [
{ "key": { "_0": "d" } },
{ "key": { "_0": "124" } }
],
"deadZone": 0.2,
"name": "MoveRight"
},
{
"bindings": [
{ "key": { "_0": " " } }
],
"deadZone": 0.2,
"name": "Attack"
}
],
"paths": {
"assets": "Assets",
"resourceRoots": [
"Assets"
],
"run": {
"workingDirectory": "."
},
"sources": "Sources"
},
"project": {
"displayName": "Medieval Arena",
"name": "MedievalArena"
},
"run": {
"arguments": [],
"destination": "macos",
"environment": {},
"workingDirectory": "."
},
"runtime": {
"entry": {
"scene": "Assets/Scenes/Main.ascn"
},
"moduleName": "MedievalArenaGame",
"plugins": {
"disable": [],
"enable": [
"multiplayer"
],
"preset": "game2d",
"presetVersion": 1,
"settings": {
"multiplayer": {
"buildIdentifier": "1",
"gameIdentifier": "org.adaengine.medieval-arena",
"host": "::1",
"peerIndex": 1,
"port": 37778,
"role": "host"
}
}
},
"window": {
"isResizable": true,
"size": {
"height": 640,
"width": 960
}
}
},
"schemaVersion": 3
}
4 changes: 4 additions & 0 deletions Demos/MedievalArena/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.build-codex/
/dist/
/.ada/workspace/
.DS_Store
22 changes: 22 additions & 0 deletions Demos/MedievalArena/Assets/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@


Tiny Dungeon (1.0)

Created/distributed by Kenney (www.kenney.nl)
Creation date: 05-07-2022

------------------------------

License: (Creative Commons Zero, CC0)
http://creativecommons.org/publicdomain/zero/1.0/

This content is free to use in personal, educational and commercial projects.
Support us by crediting Kenney or www.kenney.nl (this is not mandatory)

------------------------------

Donate: http://support.kenney.nl
Patreon: http://patreon.com/kenney/

Follow on Twitter for updates:
http://twitter.com/KenneyNL
Loading
Loading