1 decade ago by relsieg
Hi folks,
if this has already been answered, pls. forward me (havent found it on the board tho :>)
I'm trying to create a puzzle and - as it happens - I have a looot of pieces the player can move. As I don't want to create every single entity by hand, I'm looking for a dynamic way to create them (I've created one entity-JS which kind of fits for alle pieces). I have all the pieces I want to use as PNG-files ( named by numbers, starting with 0 ).
I know there's the spawnEntity-Method but as far as I can see it, you can only give the type and the coords but not the name.
Do I have to override the method or is there already something in the code that I can use?
Cheers from Berlin,
Rel
if this has already been answered, pls. forward me (havent found it on the board tho :>)
I'm trying to create a puzzle and - as it happens - I have a looot of pieces the player can move. As I don't want to create every single entity by hand, I'm looking for a dynamic way to create them (I've created one entity-JS which kind of fits for alle pieces). I have all the pieces I want to use as PNG-files ( named by numbers, starting with 0 ).
I know there's the spawnEntity-Method but as far as I can see it, you can only give the type and the coords but not the name.
Do I have to override the method or is there already something in the code that I can use?
Cheers from Berlin,
Rel