Let a variable hold a list
A variable could only be a number, a text or a yes/no, so every set of values had to be smuggled through a string - which is where Tetris got its unreadable "03066326048763714" colours from. A list is now a value of its own, with an item kind (number, text, yes/no, colour) that decides how the inspector reads the one comma-separated line it is typed as, and eight nodes to work with: List, Fill, Count, Item at, Set item, Sub list, Join lists, Index of. Two traps came with it. An array is typeof 'object', so every place that told a value from an entity had to learn the difference, or a list would have been passed around as a game object. And a value was compared by identity in three places - with lists that marks everything as an overridden property after each reload, so those comparisons now compare contents. There is no list of objects: a list is written to the project file and an object is a live handle that no reload survives. A set of objects stays a list of names. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6f907b4e0
commit
a9c3111377
25 files changed
+469
-25
No files matched your search
@@ -55,6 +55,14 @@ import { Subtract } from './data/Subtract';
|
||||
import { Time } from './data/Time';
|
||||
import { ToNumber } from './data/ToNumber';
|
||||
import { ToText } from './data/ToText';
|
||||
import { Concat } from './data/Concat';
|
||||
import { Count } from './data/Count';
|
||||
import { Fill } from './data/Fill';
|
||||
import { IndexOf } from './data/IndexOf';
|
||||
import { ItemAt } from './data/ItemAt';
|
||||
import { ListLiteral } from './data/ListLiteral';
|
||||
import { SetItem } from './data/SetItem';
|
||||
import { SubList } from './data/SubList';
|
||||
import { OnClick } from './events/OnClick';
|
||||
import { OnCollisionEnter } from './events/OnCollisionEnter';
|
||||
import { OnCollisionExit } from './events/OnCollisionExit';
|
||||
@@ -140,6 +148,15 @@ export const BUILT_IN_NODES: readonly NodeDef[] = [
|
||||
And,
|
||||
Or,
|
||||
Not,
|
||||
// data: lists
|
||||
ListLiteral,
|
||||
Fill,
|
||||
Count,
|
||||
ItemAt,
|
||||
SetItem,
|
||||
SubList,
|
||||
Concat,
|
||||
IndexOf,
|
||||
// data: vectors and input
|
||||
Length,
|
||||
Distance,
|
||||
|
||||
Reference in new issue
Block a user