Hello Guest

Author Topic: Scene.RemoveGroup(int group)  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

Fruckert

  • Member
  • Posts: 60
  • Total Square
    • View Profile
Scene.RemoveGroup(int group)
« on: March 22, 2014, 04:14:49 PM »
Not much to say about this, I just think that pause groups can be useful for more than pausing.

My personal plan for this is to differentiate manager entities from level entities and whatnot.
Maybe it can also be used for chunk culling in some sort of procedurally generated thingie?

ed: On a different note, I think a resources subforum (for prefabs and whatnot) would be useful.
« Last Edit: March 22, 2014, 04:18:52 PM by Fruckert »

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Scene.RemoveGroup(int group)
« Reply #1 on: March 24, 2014, 06:52:44 PM »
Hmm interesting.  Maybe some sort of container for entities would be handy and extending pause groups beyond just pausing could be neat.  I could add some utility functions in Scene for operating on Layers, Groups, and Orders of Entities.

Fruckert

  • Member
  • Posts: 60
  • Total Square
    • View Profile
Re: Scene.RemoveGroup(int group)
« Reply #2 on: March 24, 2014, 09:06:09 PM »
Layer manipulation would also be pretty awesome.
I can see that being used for foregrounds turning transparent when you walk into them, and whatnot.
Something like
Code: [Select]
public void OnCollide()
{
     foreach(ForegroundEntity e in Scene.Layer(100))
     {
          e.Tween(e, new {Alpha = 0}, 15);
     }
}

I'm not entirely sure what you mean by "Orders" of entities, but yeah, I'm all for group management.
It'd allow mass entity management to be pretty simple and powerful.
Like, an item that kills all of the enemies on a floor can iterate through a group and call a death method on all of the entities in the group.
Or doing synchronized effects. Think all of the enemies in New Super Mario Bros. dancing on a certain beat.
« Last Edit: March 25, 2014, 12:56:56 AM by Fruckert »

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Scene.RemoveGroup(int group)
« Reply #3 on: March 25, 2014, 02:24:05 PM »
Order is another field in Entity that you can set. It determines the update order of the entities in the scene. ;D