Dumb question about instancing #219
-
I feel like I'm overthinking instancing with Pandora but wanted to ask if this seemed like a viable strategy for using Pandora in a crafting survival prototype or if I'm missing something obvious:
So something like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I do something similar in my game: "WorldItem" is a physics object that can be dropped into any 2D scene. It exports a When the player walks close to it, it has logic to add itself to the player's inventory. Inventory then accepts "Item" and it all works perfectly. "Item" is the model representation. This allows you to base internally everything on Pandora models but then you can interface it with Godot nodes like physics objects by wrapping it (Decorator Pattern) |
Beta Was this translation helpful? Give feedback.
I do something similar in my game:
"WorldItem" is a physics object that can be dropped into any 2D scene. It exports a
PandoraEntity
which controls its attributes like appearance, stats, effects etc.When the player walks close to it, it has logic to add itself to the player's inventory. Inventory then accepts "Item" and it all works perfectly. "Item" is the model representation.
This allows you to base internally everything on Pandora models but then you can interface it with Godot nodes like physics objects by wrapping it (Decorator Pattern)