Beispiel #1
0
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();

            ll.TurnOn();
            this.PlaceObjectTo(new int2(4, 4), ll);

            LightsControl lc = new LightsControl();

            lc.TurnOn();
            lc.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(1, 1), lc);

            LightsControl lc2 = new LightsControl();

            lc2.TurnOn();
            lc2.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(3, 3), lc2);

            LightsControl lc3 = new LightsControl();

            lc3.TurnOn();
            lc3.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(2, 2), lc3);


            StaticObjects    = new MyStaticObject[4];
            StaticObjects[0] = ll;
            StaticObjects[1] = lc;
            StaticObjects[2] = lc2;
            StaticObjects[3] = lc3;
        }
Beispiel #2
0
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();

            ll.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), ll);

            /*
             * Lights lll = new Lights();
             * lll.TurnOff();
             * this.PlaceObjectTo(new int2(2, 5), lll);
             *
             * Lights llll = new Lights();
             * llll.TurnOff();
             * this.PlaceObjectTo(new int2(2, 2), llll);
             *
             */
            LightsControl lc = new LightsControl();

            lc.TurnOff();
            lc.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(1, 1), lc);

            MyDoor door2 = new MyDoor();

            door2.TurnOff();
            this.PlaceObjectTo(new int2(5, 1), door2);

            DoorControl dc = new DoorControl();

            dc.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(1, 5), dc);

            StaticObjects = new MyStaticObject[] { ll, lc, door2, dc };//,lll,llll};
        }
Beispiel #3
0
        private bool IsVisible(int apx, int apy, MyStaticObject so)
        {
            int dx = Math.Abs(so.GetPosition().x - apx);
            int dy = Math.Abs(so.GetPosition().y - apy);

            return(dx <= pars.ViewLimit && dy <= pars.ViewLimit);
        }
Beispiel #4
0
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();

            ll.TurnOn();
            this.PlaceObjectTo(new int2(6, 0), ll);

            LightsControl lc = new LightsControl();

            lc.myObjects.Add(ll);
            lc.TurnOn();
            this.PlaceObjectTo(new int2(1, 1), lc);

            // lights control
            Lights llX = new Lights();

            llX.TurnOn();
            this.PlaceObjectTo(new int2(6, 9), llX);

            LightsControl lcX = new LightsControl();

            lcX.myObjects.Add(llX);
            lcX.TurnOn();
            this.PlaceObjectTo(new int2(9, 9), lcX);

            // place into the map
            MyDoor doorX = new MyDoor();

            doorX.TurnOff();
            this.PlaceObjectTo(new int2(8, 6), doorX);

            DoorControl doorControlX = new DoorControl();

            doorControlX.myObjects.Add(doorX);
            doorControlX.TurnOff();
            this.PlaceObjectTo(new int2(4, 7), doorControlX);

            // door 2 with two controls
            MyDoor door2 = new MyDoor();

            door2.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), door2);

            DoorControl dc = new DoorControl();

            //dc.myObjects.Add(door);
            dc.myObjects.Add(door2);
            dc.TurnOff();
            this.PlaceObjectTo(new int2(1, 8), dc);

            DoorControl dc2 = new DoorControl();

            //dc2.myObjects.Add(door);
            dc2.myObjects.Add(door2);
            dc2.TurnOff();
            this.PlaceObjectTo(new int2(8, 1), dc2);

            StaticObjects = new MyStaticObject[] { dc, dc2, door2, doorX, doorControlX, lcX, llX, ll, lc };
        }
Beispiel #5
0
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();

            ll.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), ll);

            LightsControl lc = new LightsControl();

            lc.myObjects.Add(ll);
            lc.TurnOff();
            this.PlaceObjectTo(new int2(1, 1), lc);

            Lights lll = new Lights();

            lll.TurnOn();
            this.PlaceObjectTo(new int2(2, 5), lll);

            LightsControl lcc = new LightsControl();

            lcc.myObjects.Add(lll);
            lcc.TurnOn();
            this.PlaceObjectTo(new int2(4, 7), lcc);

            MyDoor door = new MyDoor();

            door.TurnOff();
            this.PlaceObjectTo(new int2(5, 1), door);

            DoorControl dc = new DoorControl();

            dc.myObjects.Add(door);
            dc.TurnOff();
            this.PlaceObjectTo(new int2(7, 7), dc);

            MyDoor door2 = new MyDoor();

            door2.TurnOn();
            this.PlaceObjectTo(new int2(7, 4), door2);

            DoorControl dc2 = new DoorControl();

            dc2.myObjects.Add(door);
            dc2.TurnOn();
            this.PlaceObjectTo(new int2(2, 8), dc2);

            StaticObjects = new MyStaticObject[] { ll, lc, lll, lcc, door2, dc2, door, dc };
        }
Beispiel #6
0
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();

            ll.TurnOn();
            this.PlaceObjectTo(new int2(3, 9), ll);

            LightsControl lc = new LightsControl();

            lc.myObjects.Add(ll);
            lc.TurnOn();
            this.PlaceObjectTo(new int2(1, 1), lc);

            StaticObjects    = new MyStaticObject[2];
            StaticObjects[0] = ll;
            StaticObjects[1] = lc;
        }
        protected override void DefineStaticObjects()
        {
            //MyDoor door2 = new MyDoor();
            //door2.TurnOff();
            //this.PlaceObjectTo(new int2(2, 3), door2);

            //DoorControl dc = new DoorControl();
            //dc.myObjects.Add(door2);
            //this.PlaceObjectTo(new int2(0, 2), dc);

            //DoorControl dc2 = new DoorControl();
            //dc2.myObjects.Add(door2);
            //this.PlaceObjectTo(new int2(1, 4), dc2);


            StaticObjects = new MyStaticObject[] { };
        }
        protected override void DefineStaticObjects()
        {
            MyDoor door2 = new MyDoor();

            door2.TurnOff();
            this.PlaceObjectTo(new int2(2, 3), door2);

            DoorControl dc = new DoorControl();

            dc.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(0, 2), dc);

            DoorControl dc2 = new DoorControl();

            dc2.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(1, 4), dc2);


            StaticObjects = new MyStaticObject[] { door2, dc, dc2 };//,lll,llll};
        }
Beispiel #9
0
        protected override void DefineStaticObjects()
        {
            // place into the map
            MyDoor door = new MyDoor();

            door.TurnOff();
            this.PlaceObjectTo(new int2(12, 5), door);

            DoorControl dc = new DoorControl();

            dc.myObjects.Add(door);
            dc.TurnOff();
            this.PlaceObjectTo(new int2(9, 9), dc);

            DoorControl dc2 = new DoorControl();

            dc2.myObjects.Add(door);
            dc2.TurnOff();
            this.PlaceObjectTo(new int2(10, 1), dc2);

            Lights l = new Lights();

            l.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), l);

            Lights ll = new Lights();

            ll.TurnOff();
            this.PlaceObjectTo(new int2(1, 1), ll);

            LightsControl lc = new LightsControl();

            lc.myObjects.Add(l);
            lc.myObjects.Add(ll);
            lc.TurnOff();
            this.PlaceObjectTo(new int2(6, 6), lc);

            StaticObjects = new MyStaticObject[] { dc, door, dc2, lc, l, ll };
        }
Beispiel #10
0
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();

            ll.TurnOn();
            this.PlaceObjectTo(new int2(7, 7), ll);

            LightsControl lc = new LightsControl();

            lc.myObjects.Add(ll);
            lc.TurnOn();
            this.PlaceObjectTo(new int2(1, 1), lc);

            /*
             * // place into the map
             * Door door = new Door();
             * door.turnOff();
             * this.placeObjectTo(new int2(5, 4), door);
             */
            MyDoor door2 = new MyDoor();

            door2.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), door2);

            /*
             * DoorControl dc = new DoorControl();
             * //dc.myObjects.Add(door);
             * dc.myObjects.Add(door2);
             * this.PlaceObjectTo(new int2(1, 8), dc);
             */

            DoorControl dc2 = new DoorControl();

            //dc2.myObjects.Add(door);
            dc2.myObjects.Add(door2);
            dc2.TurnOff();
            this.PlaceObjectTo(new int2(8, 1), dc2);
            StaticObjects = new MyStaticObject[] { ll, lc, dc2, door2 };
        }
Beispiel #11
0
        protected override void DefineStaticObjects()
        {
            // place into the map
            MyDoor door = new MyDoor();

            door.TurnOn();
            this.PlaceObjectTo(new int2(2, 3), door);

            DoorControl dc = new DoorControl();

            dc.myObjects.Add(door);
            dc.TurnOn();
            this.PlaceObjectTo(new int2(11, 7), dc);

            MyDoor door2 = new MyDoor();

            door2.TurnOn();
            this.PlaceObjectTo(new int2(7, 7), door2);

            DoorControl dc2 = new DoorControl();

            dc2.myObjects.Add(door2);
            dc2.TurnOn();
            this.PlaceObjectTo(new int2(12, 3), dc2);

            Lights l = new Lights();

            l.TurnOff();
            this.PlaceObjectTo(new int2(3, 7), l);

            LightsControl lc = new LightsControl();

            lc.myObjects.Add(l);
            lc.TurnOff();
            this.PlaceObjectTo(new int2(0, 0), lc);

            StaticObjects = new MyStaticObject[] { dc, door, door2, dc2, l, lc };
        }
        protected override void DefineStaticObjects()
        {
            // place into the map
            MyDoor door = new MyDoor();
            door.TurnOn();
            this.PlaceObjectTo(new int2(2, 3), door);

            DoorControl dc = new DoorControl();
            dc.myObjects.Add(door);
            dc.TurnOn();
            this.PlaceObjectTo(new int2(11, 7), dc);

            MyDoor door2 = new MyDoor();
            door2.TurnOn();
            this.PlaceObjectTo(new int2(7, 7), door2);

            DoorControl dc2 = new DoorControl();
            dc2.myObjects.Add(door2);
            dc2.TurnOn();
            this.PlaceObjectTo(new int2(12, 3), dc2);

            Lights l = new Lights();
            l.TurnOff();
            this.PlaceObjectTo(new int2(3, 7), l);

            LightsControl lc = new LightsControl();
            lc.myObjects.Add(l);
            lc.TurnOff();
            this.PlaceObjectTo(new int2(0, 0), lc);

            StaticObjects = new MyStaticObject[] { dc, door, door2, dc2, l, lc };
        }
        protected override void DefineStaticObjects()
        {
            MyDoor door2 = new MyDoor();
            door2.TurnOff();
            this.PlaceObjectTo(new int2(2, 3), door2);

            DoorControl dc = new DoorControl();
            dc.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(0, 2), dc);

            DoorControl dc2 = new DoorControl();
            dc2.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(1, 4), dc2);

            StaticObjects = new MyStaticObject[] { door2, dc, dc2 };//,lll,llll};
        }
 public void PlaceObjectTo(int2 pos, MyStaticObject obj)
 {
     obj.setPosition(pos);
     this.DeleteObstacle(pos.x, pos.y);
     Tiles[pos.x, pos.y].Objects.Add(obj);
 }
        protected override void DefineStaticObjects()
        {
            // place into the map
            MyDoor door = new MyDoor();
            door.TurnOff();
            this.PlaceObjectTo(new int2(12, 5), door);

            DoorControl dc = new DoorControl();
            dc.myObjects.Add(door);
            dc.TurnOff();
            this.PlaceObjectTo(new int2(9, 9), dc);

            DoorControl dc2 = new DoorControl();
            dc2.myObjects.Add(door);
            dc2.TurnOff();
            this.PlaceObjectTo(new int2(10, 1), dc2);

            Lights l = new Lights();
            l.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), l);

            Lights ll = new Lights();
            ll.TurnOff();
            this.PlaceObjectTo(new int2(1, 1), ll);

            LightsControl lc = new LightsControl();
            lc.myObjects.Add(l);
            lc.myObjects.Add(ll);
            lc.TurnOff();
            this.PlaceObjectTo(new int2(6, 6), lc);

            StaticObjects = new MyStaticObject[] { dc, door, dc2, lc, l, ll };
        }
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();
            ll.TurnOn();
            this.PlaceObjectTo(new int2(7, 7), ll);

            LightsControl lc = new LightsControl();
            lc.myObjects.Add(ll);
            lc.TurnOn();
            this.PlaceObjectTo(new int2(1, 1), lc);

            /*
            // place into the map
            Door door = new Door();
            door.turnOff();
            this.placeObjectTo(new int2(5, 4), door);
            */
            MyDoor door2 = new MyDoor();
            door2.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), door2);

            /*
            DoorControl dc = new DoorControl();
            //dc.myObjects.Add(door);
            dc.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(1, 8), dc);
            */

            DoorControl dc2 = new DoorControl();
            //dc2.myObjects.Add(door);
            dc2.myObjects.Add(door2);
            dc2.TurnOff();
            this.PlaceObjectTo(new int2(8, 1), dc2);
            StaticObjects = new MyStaticObject[] { ll, lc, dc2, door2 };
        }
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();
            ll.TurnOn();
            this.PlaceObjectTo(new int2(3, 9), ll);

            LightsControl lc = new LightsControl();
            lc.myObjects.Add(ll);
            lc.TurnOn();
            this.PlaceObjectTo(new int2(1, 1), lc);

            StaticObjects = new MyStaticObject[2];
            StaticObjects[0] = ll;
            StaticObjects[1] = lc;
        }
Beispiel #18
0
 public void PlaceObjectTo(int2 pos, MyStaticObject obj)
 {
     obj.setPosition(pos);
     this.DeleteObstacle(pos.x, pos.y);
     Tiles[pos.x, pos.y].Objects.Add(obj);
 }
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();
            ll.TurnOff();
            this.PlaceObjectTo(new int2(4, 4), ll);
            /*
            Lights lll = new Lights();
            lll.TurnOff();
            this.PlaceObjectTo(new int2(2, 5), lll);

            Lights llll = new Lights();
            llll.TurnOff();
            this.PlaceObjectTo(new int2(2, 2), llll);

            */
            LightsControl lc = new LightsControl();
            lc.TurnOff();
            lc.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(2, 2), lc);

            MyDoor door2 = new MyDoor();
            door2.TurnOff();
            this.PlaceObjectTo(new int2(4, 2), door2);

            DoorControl dc = new DoorControl();
            dc.myObjects.Add(door2);
            this.PlaceObjectTo(new int2(2, 4), dc);

            StaticObjects = new MyStaticObject[] { ll, lc, door2, dc };//,lll,llll};
        }
Beispiel #20
0
            public override void Execute()
            {
                // draw the visible area of the map (empty and obstacle tales)
                MyGraphicsPrototype taleEmpty    = Owner.m_tale_empty_g;
                MyGraphicsPrototype taleObstacle = Owner.m_tale_obstacle_g;

                m_drawTalesKernel.SetupExecution(Owner.VISIBLE_WIDTH * Owner.VISIBLE_HEIGHT);
                m_drawTalesKernel.Run(Owner.Visual, Owner.VISIBLE_WIDTH, Owner.VISIBLE_HEIGHT,
                                      Owner.MapTales, Owner.World.GetWidth(), Owner.World.GetHeight(),
                                      taleEmpty.Bitmap, taleObstacle.Bitmap, taleEmpty.PixelSize);

                // draw static objects
                MyStaticObject[] objects = Owner.World.GetStaticObjects();
                for (int i = 0; i < objects.Length; i++)
                {
                    MyStaticObject o = objects[i];

                    m_drawObjKernel.SetupExecution(o.Graphics.PixelSize.x * o.Graphics.PixelSize.y);

                    m_drawObjKernel.Run(Owner.Visual, Owner.RES,
                                        Owner.VISIBLE_WIDTH, Owner.VISIBLE_HEIGHT,
                                        o.Graphics.Bitmap, o.GetPosition(), o.Graphics.PixelSize);
                }

                // draw the agent
                MyMovingObject      agent   = Owner.World.GetAgent();
                MyGraphicsPrototype agent_g = agent.Graphics;

                m_agentPosition.x = agent.GetPosition().x *Owner.RES;
                m_agentPosition.y = (agent.GetPosition().y + 1) * Owner.RES - 1;

                if (!Owner.ShowInEgocentricView)
                {
                    this.DrawEgocentric();
                }

                if (Owner.UpdateTask.ContinuousMovement && Owner.m_performingMovement)
                {
                    switch (Owner.LastAction)
                    {
                    case AGENT_ACTIONS.LEFT:
                    {
                        m_agentPosition.x += Owner.m_movementCooldown;
                        break;
                    }

                    case AGENT_ACTIONS.RIGHT:
                    {
                        m_agentPosition.x -= Owner.m_movementCooldown;
                        break;
                    }

                    case AGENT_ACTIONS.UP:
                    {
                        m_agentPosition.y -= Owner.m_movementCooldown;
                        break;
                    }

                    case AGENT_ACTIONS.DOWN:
                    {
                        m_agentPosition.y += Owner.m_movementCooldown;
                        break;
                    }
                    }

                    m_drawFreeObjKernel.SetupExecution(agent_g.PixelSize.x * agent_g.PixelSize.y);
                    m_drawFreeObjKernel.Run(Owner.Visual, Owner.VISIBLE_WIDTH, Owner.VISIBLE_HEIGHT, agent_g.Bitmap,
                                            m_agentPosition, agent_g.PixelSize);
                }
                else
                {
                    m_drawObjKernel.SetupExecution(agent_g.PixelSize.x * agent_g.PixelSize.y);
                    m_drawObjKernel.Run(Owner.Visual, Owner.RES,
                                        Owner.VISIBLE_WIDTH, Owner.VISIBLE_HEIGHT,
                                        agent_g.Bitmap, agent.GetPosition(), agent_g.PixelSize);
                }

                if (Owner.ShowInEgocentricView)
                {
                    this.DrawEgocentric();
                }
            }
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();
            ll.TurnOn();
            this.PlaceObjectTo(new int2(6, 0), ll);

            LightsControl lc = new LightsControl();
            lc.myObjects.Add(ll);
            lc.TurnOn();
            this.PlaceObjectTo(new int2(1, 1), lc);

            // lights control
            Lights llX = new Lights();
            llX.TurnOn();
            this.PlaceObjectTo(new int2(6, 9), llX);

            LightsControl lcX = new LightsControl();
            lcX.myObjects.Add(llX);
            lcX.TurnOn();
            this.PlaceObjectTo(new int2(9, 9), lcX);

            // place into the map
            MyDoor doorX = new MyDoor();
            doorX.TurnOff();
            this.PlaceObjectTo(new int2(8, 6), doorX);

            DoorControl doorControlX = new DoorControl();
            doorControlX.myObjects.Add(doorX);
            doorControlX.TurnOff();
            this.PlaceObjectTo(new int2(4, 7), doorControlX);

            // door 2 with two controls
            MyDoor door2 = new MyDoor();
            door2.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), door2);

            DoorControl dc = new DoorControl();
            //dc.myObjects.Add(door);
            dc.myObjects.Add(door2);
            dc.TurnOff();
            this.PlaceObjectTo(new int2(1, 8), dc);

            DoorControl dc2 = new DoorControl();
            //dc2.myObjects.Add(door);
            dc2.myObjects.Add(door2);
            dc2.TurnOff();
            this.PlaceObjectTo(new int2(8, 1), dc2);

            StaticObjects = new MyStaticObject[] { dc, dc2, door2, doorX, doorControlX, lcX, llX, ll, lc };
        }
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();
            ll.TurnOn();
            this.PlaceObjectTo(new int2(4, 4), ll);

            LightsControl lc = new LightsControl();
            lc.TurnOn();
            lc.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(1, 1), lc);

            LightsControl lc2 = new LightsControl();
            lc2.TurnOn();
            lc2.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(3, 3), lc2);

            LightsControl lc3 = new LightsControl();
            lc3.TurnOn();
            lc3.myObjects.Add(ll);
            this.PlaceObjectTo(new int2(2, 2), lc3);

            StaticObjects = new MyStaticObject[4];
            StaticObjects[0] = ll;
            StaticObjects[1] = lc;
            StaticObjects[2] = lc2;
            StaticObjects[3] = lc3;
        }
        private bool IsVisible(int apx, int apy, MyStaticObject so)
        {
            int dx = Math.Abs(so.GetPosition().x - apx);
            int dy = Math.Abs(so.GetPosition().y - apy);

            return dx <= pars.ViewLimit && dy <= pars.ViewLimit;
        }
        protected override void DefineStaticObjects()
        {
            Lights ll = new Lights();
            ll.TurnOff();
            this.PlaceObjectTo(new int2(5, 5), ll);

            LightsControl lc = new LightsControl();
            lc.myObjects.Add(ll);
            lc.TurnOff();
            this.PlaceObjectTo(new int2(1, 1), lc);

            Lights lll = new Lights();
            lll.TurnOn();
            this.PlaceObjectTo(new int2(2, 5), lll);

            LightsControl lcc = new LightsControl();
            lcc.myObjects.Add(lll);
            lcc.TurnOn();
            this.PlaceObjectTo(new int2(4, 7), lcc);

            MyDoor door = new MyDoor();
            door.TurnOff();
            this.PlaceObjectTo(new int2(5, 1), door);

            DoorControl dc = new DoorControl();
            dc.myObjects.Add(door);
            dc.TurnOff();
            this.PlaceObjectTo(new int2(7, 7), dc);

            MyDoor door2 = new MyDoor();
            door2.TurnOn();
            this.PlaceObjectTo(new int2(7, 4), door2);

            DoorControl dc2 = new DoorControl();
            dc2.myObjects.Add(door);
            dc2.TurnOn();
            this.PlaceObjectTo(new int2(2, 8), dc2);

            StaticObjects = new MyStaticObject[] { ll, lc, lll, lcc, door2, dc2, door, dc };
        }