

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
click for more info
Not enough gems
Cost: 6 gems
1: SnekObjects
incomplete
2: Integer
incomplete
3: Float
incomplete
4: String
incomplete
5: Vector3
incomplete
6: Array
incomplete
7: Set
incomplete
8: Get
incomplete
9: Length
incomplete
10: Add
incomplete
This lesson's interactive features are locked, please to keep using them
Vector3 is going to be the first Snek Object that can hold a reference to another Snek Object. It's a collection type: a type that holds other types.
Arrays, lists, dictionaries, and sets are all examples of collection types. We won't implement all of those types in this course, but they each will follow the same pattern that we're establishing here with Vector3.
Vector3 is similar to a Python tuple that contains exactly 3 "SnekObject" elements.
The v_vector3 field is not a pointer to a vector3; it's directly allocated inside the struct. We can do this because we know the size of the vector (it's only 3 pointers wide) in advance.