Yeah, that does look a bit better. I am changing it.Virtuous Sword wrote:I don't mean to be funny, but do you intend to add some visual confirmation that an entry can be expanded? such as brackets or a '+' next to it, perhaps on the left?
edit: oh I see you put the number of child slices on the right, forgive me.... maybe something on the left e.g.'+' might be more visually immediate?
Collision checking with "slice collide" tests if the slices overlap based on their screen positions-- so it doesn't really matter how they are parented, as long as they are displaying as overlapping.How do layers relate to collisions?
layering does matter more for "find colliding slice", since it may or may not be checking child slices depending on how you call it, but the basic rule is still true, if the slices look like they are overlapping, then it will detect them as colliding.
You can do that too. see the "get hero slice" and "get npc slice" commands.What if I want to check for collisions with hero sprite slices or NPC sprite slices?
If the enemies in your game are just regular NPCs then you would be best off using "next npc" to loop through each of them, and then use "get npc slice" to get the slice that you will be checking against your attack hitbox layer.
You mean the attack hitboxes are parented to an NPC slice?Currently, I'm making parenting a slice to a NPC, so that it's unaffected by screen movement.
That can work, but makes checking for collision more work, because you have to loop through each NPC yourself and check its children.
I suggest creating a container to be your hitbox layer. Attach it to the same map layer that has heroes and NPCs on it, and set it to fill its parent. That will make the container exactly the same size as the map layer.
Then you can parent your hitboxes to the hitbox layer, and set their X,Y position based on the NPC pixel x and NPC pixel y of the npcs (which also happens to be the same as the slice x and slice y of an NPC's slice)
...actually, that method works well if your hit boxes are instantaneous and only stick around for one game tick. If they last longer than that, and you want them to move along with to the NPC they are attached to, then it is better to parent the hitboxes to the NPC, and just accept that you will need to write some more complicated collision checking.
Have you had any experience yet with looping over all NPCs in a script? Or with looping over all the child slices of a parent slice? If not, I can find you some examples.
No problem, you actually seem to be holding your own quite well :)Sorry for the questions, I'm not really good at coding/scripting.