Example #1
0
        private void MakeToungue(EntityRegistry registry, Entity parentFrog)
        {
            Entity       toungue = registry.Create();
            ToungueState state   = new ToungueState(ToungueStages.Extending, mData.GetStateTime(ToungueStages.Extending));

            registry.AddComponent(toungue, state);
            registry.AddComponent(toungue, new RectShape());
            registry.AddComponent(toungue, new Position());
            registry.AddComponent(toungue, Color.Red);
            registry.AddComponent(toungue, new ParentEntity(parentFrog, new Vector2()));

            ControlledEntity controlledToungue = new ControlledEntity(toungue);

            registry.AddComponent(parentFrog, controlledToungue);
        }
Example #2
0
        public Entity MakePlayer(int index, EntityRegistry registry)
        {
            AssertIndexIsNotUsed(index);

            Entity playerEntity = registry.Create();

            registry.AddComponent(playerEntity, new Player(index));

            Entity frogEntity = mFrogFactory.MakeFrog(index, registry);

            ControlledEntity controlledEntity = new ControlledEntity(frogEntity);

            registry.AddComponent(playerEntity, controlledEntity);

            return(playerEntity);
        }