Exemplo n.º 1
0
        public static void Affichage()
        {
            foreach (GameObject go in Global.Entities.OrderBy(x => x.Layer))
            {
                CDrawable drawable = go.GetComponent <CDrawable>();
                if (drawable != null)
                {
                    drawable.Draw();
                }
            }

            DebugMode.Update();
        }
Exemplo n.º 2
0
        public PeaEntity(float posX, float posY, double ShootSpeed, int shootDamage)
        {
            AI       = new AIPea(this);
            Layer    = 3;
            drawable = AddComponent(new CDrawable()) as CDrawable;
            moveable = AddComponent(new CMoveable()) as CMoveable;
            health   = AddComponent(new CHealth()) as CHealth;

            moveable.Speed   = new System.Drawing.Point((int)ShootSpeed, 0);
            health.InitialHP = 1;

            this.posX = posX;
            this.posY = posY;

            drawable.HitBox = new System.Drawing.Size(20, 20);
        }
Exemplo n.º 3
0
        public MeowerEntity(int posX, int posY)
        {
            Layer = 4;
            AI    = new AIMeower(this);
            Tags.Add("Meower");

            this.posX = posX;
            this.posY = posY;

            drawable = AddComponent(new CDrawable()) as CDrawable;
            moveable = AddComponent(new CMoveable()) as CMoveable;

            drawable.HitBox  = new Size(55, 54);
            drawable.Sprites = new List <string> {
                "tondeuse"
            };
        }
Exemplo n.º 4
0
        public override void DoIt()
        {
            CHealth   health  = AssociatedGameObject.GetComponent <CHealth>();
            CDrawable nutDraw = AssociatedGameObject.GetComponent <CDrawable>();

            if (health.HP > 1333)
            {
                nutDraw.cycle = 0;
            }
            else if (health.HP < 1332 && health.HP > 666)
            {
                nutDraw.cycle = 1;
            }
            else
            {
                nutDraw.cycle = 2;
            }
        }
Exemplo n.º 5
0
        public SunEntity(int posX, int posY, int endingY)
        {
            Layer = 3;
            AI    = new AISun(this);
            Tags.Add("Sun");

            this.posX    = posX;
            this.posY    = posY;
            this.EndingY = endingY;

            drawable = AddComponent(new CDrawable()) as CDrawable;
            moveable = AddComponent(new CMoveable()) as CMoveable;
            AddComponent(new CClickable());
            AddComponent(new CDisappear(500));

            moveable.InitialSpeed = new Point(0, -50);

            drawable.HitBox  = new Size(55, 54);
            drawable.Sprites = new List <string> {
                "soleil"
            };
        }