Exemplo n.º 1
0
        void DrawScene(Scene s)
        {
            if (s == null)
            {
                return;
            }
            int l = 0;

            foreach (TileLayer tl in s.TileLayers)
            {
                int lastl = 3, nextl = 3, drawl = 3;
                try
                {
                    lastl = s[(int)game.ME.LastLocation.Y, (int)game.ME.LastLocation.X].DrawLayer;
                    nextl = s[(int)game.ME.NextLocation.Y, (int)game.ME.NextLocation.X].DrawLayer;
                    Vector3 drawloc = game.ME.GetDrawLocation(game.Options.TilePixelX, lastl, nextl);
                    drawl = s[(int)drawloc.Y, (int)drawloc.X].DrawLayer;
                }
                catch { }
                //int lastl = s.CodeLayer[game.ME.LastLocation].DrawLayer;
                //int nextl = s.CodeLayer[game.ME.NextLocation].DrawLayer;
                //int drawl = s.CodeLayer[game.ME.GetDrawLocation(game.Options.TilePixelX, lastl, nextl)].DrawLayer;
                //int nodrawl = s.CodeLayer[game.ME.FrontLocation].RchDisappear;
                if (PCbeforeNPC)
                {
                    if (l == drawl)
                    {
                        DrawCHR(game.ME);
                    }
                }
                if (game.NPCs != null)
                {
                    foreach (NPC npc in game.NPCs)
                    {
                        int npcdrawl = s.CodeLayer[npc.GetDrawLocation(game.Options.TilePixelX, lastl, nextl)].DrawLayer;
                        if (l == npcdrawl)
                        {
                            DrawCHR(npc);
                        }
                    }
                }
                if (PCbeforeNPC == false)
                {
                    if (l == drawl)
                    {
                        DrawCHR(game.ME);
                    }
                }
                foreach (Tile t in tl.Tiles)
                {
                    if (IsInWindow(Util.PointAddPoint(t.LocationPoint, s.RealLocationPoint)))
                    {
                        int fi = 0;
                        fi = frameIndex;
                        float rot = 0 % 360;
                        if (t[fi].TextureIndex == 451)
                        {
                            rot = 100;
                        }
                        game.DrawMetalXTexture(
                            game.Textures[t[fi].TextureIndex],
                            t[fi].DrawZone,
                            Util.Vector3AddVector3(Util.Vector3AddVector3(s.RealLocationPixel, ScreenOffsetPixel), Util.Vector3MulInt(t.Location, game.Options.TilePixelX)),
                            game.Options.TileSizePixelX,
                            rot,
                            Util.MixColor(t[fi].ColorFilter, ColorFilter)
                        );
                    }
                }
                l++;
            }
        }
Exemplo n.º 2
0
        public bool Move(Scene s, NPC n, int stepPixel)
        {
            if (CanMove == false)
            {
                return false;
            }
            if (s.IsInScene(FrontLocation) == false)
            {
                return false;
            }
            if (n != null)
            {
                if (n.IsDoor == false)
                {
                    return false;
                }
            }
            try
            {
                if (s[FrontLocation].CHRCanRch == false)
                {
                    return false;
                }
            }
            catch
            {
                //return false;
            }

            LastLocation = RealLocation;
            RealLocation = NextLocation = FrontLocation;
            NeedMoveStep = 1;
            NeedMovePixel += 1 * stepPixel;
            return true;
        }