示例#1
0
 public override void render(Screen screen)
 {
     screen.render(x - 8, y - 8 - 4, sprite * 2 + 8 * 32, col, 0);
     screen.render(x - 0, y - 8 - 4, sprite * 2 + 8 * 32 + 1, col, 0);
     screen.render(x - 8, y - 0 - 4, sprite * 2 + 8 * 32 + 32, col, 0);
     screen.render(x - 0, y - 0 - 4, sprite * 2 + 8 * 32 + 33, col, 0);
 }
示例#2
0
 public override void render(Screen screen)
 {
     int col = ColorHelper.get(-1, 555, 555, 555);
     screen.render(x - 8, y - 8, 5 + 12 * 32, col, 2);
     screen.render(x - 0, y - 8, 5 + 12 * 32, col, 3);
     screen.render(x - 8, y - 0, 5 + 12 * 32, col, 0);
     screen.render(x - 0, y - 0, 5 + 12 * 32, col, 1);
 }
示例#3
0
 public override void render(Screen screen, Level level, int x, int y)
 {
     int col = ColorHelper.get(level.dirtColor, level.dirtColor, level.dirtColor - 111, level.dirtColor - 111);
     screen.render(x * 16 + 0, y * 16 + 0, 0, col, 0);
     screen.render(x * 16 + 8, y * 16 + 0, 1, col, 0);
     screen.render(x * 16 + 0, y * 16 + 8, 2, col, 0);
     screen.render(x * 16 + 8, y * 16 + 8, 3, col, 0);
 }
示例#4
0
 public override void render(Screen screen, Level level, int x, int y)
 {
     int col = ColorHelper.get(20, 40, 50, level.sandColor);
     screen.render(x * 16 + 0, y * 16 + 0, 8 + 2 * 32, col, 0);
     screen.render(x * 16 + 8, y * 16 + 0, 9 + 2 * 32, col, 0);
     screen.render(x * 16 + 0, y * 16 + 8, 8 + 3 * 32, col, 0);
     screen.render(x * 16 + 8, y * 16 + 8, 9 + 3 * 32, col, 0);
 }
示例#5
0
 public override void render(Screen screen, Level level, int x, int y)
 {
     //TODO: check is casting to int is ok
     color = (int)(toDrop.color & 0xffffff00) + ColorHelper.get(level.dirtColor);
     screen.render(x * 16 + 0, y * 16 + 0, 17 + 1 * 32, color, 0);
     screen.render(x * 16 + 8, y * 16 + 0, 18 + 1 * 32, color, 0);
     screen.render(x * 16 + 0, y * 16 + 8, 17 + 2 * 32, color, 0);
     screen.render(x * 16 + 8, y * 16 + 8, 18 + 2 * 32, color, 0);
 }
示例#6
0
 public override void render(Screen screen)
 {
     if (time >= lifeTime - 6 * 20)
     {
         if (time / 6 % 2 == 0) return;
     }
     screen.render(x - 4, y - 4, item.getSprite(), ColorHelper.get(-1, 0, 0, 0), 0);
     screen.render(x - 4, y - 4 - (int)(zz), item.getSprite(), item.getColor(), 0);
 }
示例#7
0
 public override void render(Screen screen, Level level, int x, int y)
 {
     int color = ColorHelper.get(level.dirtColor, 000, 333, 444);
     int xt = 0;
     if (leadsUp) xt = 2;
     screen.render(x * 16 + 0, y * 16 + 0, xt + 2 * 32, color, 0);
     screen.render(x * 16 + 8, y * 16 + 0, xt + 1 + 2 * 32, color, 0);
     screen.render(x * 16 + 0, y * 16 + 8, xt + 3 * 32, color, 0);
     screen.render(x * 16 + 8, y * 16 + 8, xt + 1 + 3 * 32, color, 0);
 }
示例#8
0
        public static void renderFrame(Screen screen, string title, int x0, int y0, int x1, int y1)
        {
            for (int y = y0; y <= y1; y++)
            {
                for (int x = x0; x <= x1; x++)
                {
                    if (x == x0 && y == y0)
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 0);
                    else if (x == x1 && y == y0)
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 1);
                    else if (x == x0 && y == y1)
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 2);
                    else if (x == x1 && y == y1)
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 3);
                    else if (y == y0)
                        screen.render(x * 8, y * 8, 1 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 0);
                    else if (y == y1)
                        screen.render(x * 8, y * 8, 1 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 2);
                    else if (x == x0)
                        screen.render(x * 8, y * 8, 2 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 0);
                    else if (x == x1)
                        screen.render(x * 8, y * 8, 2 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 1);
                    else
                        screen.render(x * 8, y * 8, 2 + 13 * 32, ColorHelper.get(5, 5, 5, 5), 1);
                }
            }

            draw(title, screen, x0 * 8 + 8, y0 * 8, ColorHelper.get(5, 5, 5, 550));

        }
示例#9
0
        public override void render(Screen screen)
        {
            if (time >= lifeTime - 6 * 20)
            {
                if (time / 6 % 2 == 0) return;
            }

            int xt = 8;
            int yt = 13;

            screen.render(x - 4, y - 4 - 2, xt + yt * 32, ColorHelper.get(-1, 555, 555, 555), random.nextInt(4));
            screen.render(x - 4, y - 4 + 2, xt + yt * 32, ColorHelper.get(-1, 000, 000, 000), random.nextInt(4));
        }
示例#10
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            base.render(screen, level, x, y);

            int data = level.getData(x, y);
            int shape = (data / 16) % 2;
            int flowerCol = ColorHelper.get(10, level.grassColor, 555, 440);

            if (shape == 0) screen.render(x * 16 + 0, y * 16 + 0, 1 + 1 * 32, flowerCol, 0);
            if (shape == 1) screen.render(x * 16 + 8, y * 16 + 0, 1 + 1 * 32, flowerCol, 0);
            if (shape == 1) screen.render(x * 16 + 0, y * 16 + 8, 1 + 1 * 32, flowerCol, 0);
            if (shape == 0) screen.render(x * 16 + 8, y * 16 + 8, 1 + 1 * 32, flowerCol, 0);
        }
示例#11
0
        public override void render(Screen screen)
        {
            screen.clear(0);

            int h = 2;
            int w = 13;
            int titleColor = ColorHelper.get(0, 010, 131, 551);
            int xo = (screen.w - w * 8) / 2;
            int yo = 24;
            for (int y = 0; y < h; y++)
            {
                for (int x = 0; x < w; x++)
                {
                    screen.render(xo + x * 8, yo + y * 8, x + (y + 6) * 32, titleColor, 0);
                }
            }

            for (int i = 0; i < 3; i++)
            {
                string msg = options[i];
                int col = ColorHelper.get(0, 222, 222, 222);
                if (i == selected)
                {
                    msg = "> " + msg + " <";
                    col = ColorHelper.get(0, 555, 555, 555);
                }
                Font.draw(msg, screen, (screen.w - msg.Length * 8) / 2, (8 + i) * 8, col);
            }

            Font.draw("(Arrow keys,X and C)", screen, 0, screen.h - 8, ColorHelper.get(0, 111, 111, 111));
        }
 public override void render(Screen screen)
 {
     for (int x = 0; x < 20; x++)
     {
         for (int y = 0; y < 15; y++)
         {
             int dd = (y + x % 2 * 2 + x / 3) - time;
             if (dd < 0 && dd > -30)
             {
                 if (dir > 0)
                     screen.render(x * 8, y * 8, 0, 0, 0);
                 else
                     screen.render(x * 8, screen.h - y * 8 - 8, 0, 0, 0);
             }
         }
     }
 }
示例#13
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int col = ColorHelper.get(level.sandColor + 2, level.sandColor, level.sandColor - 110, level.sandColor - 110);
            int transitionColor = ColorHelper.get(level.sandColor - 110, level.sandColor, level.sandColor - 110, level.dirtColor);

            bool u = !level.getTile(x, y - 1).connectsToSand;
            bool d = !level.getTile(x, y + 1).connectsToSand;
            bool l = !level.getTile(x - 1, y).connectsToSand;
            bool r = !level.getTile(x + 1, y).connectsToSand;

            bool steppedOn = level.getData(x, y) > 0;

            if (!u && !l)
            {
                if (!steppedOn)
                    screen.render(x * 16 + 0, y * 16 + 0, 0, col, 0);
                else
                    screen.render(x * 16 + 0, y * 16 + 0, 3 + 1 * 32, col, 0);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 0, (l ? 11 : 12) + (u ? 0 : 1) * 32, transitionColor, 0);

            if (!u && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 0, 1, col, 0);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 0, (r ? 13 : 12) + (u ? 0 : 1) * 32, transitionColor, 0);

            if (!d && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 8, 2, col, 0);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 8, (l ? 11 : 12) + (d ? 2 : 1) * 32, transitionColor, 0);
            if (!d && !r)
            {
                if (!steppedOn)
                    screen.render(x * 16 + 8, y * 16 + 8, 3, col, 0);
                else
                    screen.render(x * 16 + 8, y * 16 + 8, 3 + 1 * 32, col, 0);

            }
            else
                screen.render(x * 16 + 8, y * 16 + 8, (r ? 13 : 12) + (d ? 2 : 1) * 32, transitionColor, 0);
        }
示例#14
0
 public override void renderInventory(Screen screen, int x, int y)
 {
     screen.render(x, y, resource.sprite, resource.color, 0);
     Font.draw(resource.name, screen, x + 32, y, ColorHelper.get(-1, 555, 555, 555));
     int cc = count;
     if (cc > 999) cc = 999;
     Font.draw("" + cc, screen, x + 8, y, ColorHelper.get(-1, 444, 444, 444));
 }
示例#15
0
        public static void renderFrame(Screen screen, string title, int x0, int y0, int x1, int y1)
        {
            for (int y = y0; y <= y1; y++)
            {
                for (int x = x0; x <= x1; x++)
                {
                    if (x == x0 && y == y0)
                    {
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 0);
                    }
                    else if (x == x1 && y == y0)
                    {
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 1);
                    }
                    else if (x == x0 && y == y1)
                    {
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 2);
                    }
                    else if (x == x1 && y == y1)
                    {
                        screen.render(x * 8, y * 8, 0 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 3);
                    }
                    else if (y == y0)
                    {
                        screen.render(x * 8, y * 8, 1 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 0);
                    }
                    else if (y == y1)
                    {
                        screen.render(x * 8, y * 8, 1 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 2);
                    }
                    else if (x == x0)
                    {
                        screen.render(x * 8, y * 8, 2 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 0);
                    }
                    else if (x == x1)
                    {
                        screen.render(x * 8, y * 8, 2 + 13 * 32, ColorHelper.get(-1, 1, 5, 445), 1);
                    }
                    else
                    {
                        screen.render(x * 8, y * 8, 2 + 13 * 32, ColorHelper.get(5, 5, 5, 5), 1);
                    }
                }
            }

            draw(title, screen, x0 * 8 + 8, y0 * 8, ColorHelper.get(5, 5, 5, 550));
        }
示例#16
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int age = level.getData(x, y);
            int col = ColorHelper.get(level.dirtColor - 121, level.dirtColor - 11, level.dirtColor, 50);
            int icon = age / 10;
            if (icon >= 3)
            {
                col = ColorHelper.get(level.dirtColor - 121, level.dirtColor - 11, 50 + (icon) * 100, 40 + (icon - 3) * 2 * 100);
                if (age == 50)
                {
                    col = ColorHelper.get(0, 0, 50 + (icon) * 100, 40 + (icon - 3) * 2 * 100);
                }
                icon = 3;
            }

            screen.render(x * 16 + 0, y * 16 + 0, 4 + 3 * 32 + icon, col, 0);
            screen.render(x * 16 + 8, y * 16 + 0, 4 + 3 * 32 + icon, col, 0);
            screen.render(x * 16 + 0, y * 16 + 8, 4 + 3 * 32 + icon, col, 1);
            screen.render(x * 16 + 8, y * 16 + 8, 4 + 3 * 32 + icon, col, 1);
        }
示例#17
0
 public static void draw(string msg, Screen screen, int x, int y, int col)
 {
     msg = msg.ToUpper();
     for (int i = 0; i < msg.Length; i++)
     {
         int ix = chars.IndexOf(msg[i]);
         if (ix >= 0)
         {
             screen.render(x + i * 8, y, ix + 30 * 32, col, 0);
         }
     }
 }
示例#18
0
 public static void draw(string msg, Screen screen, int x, int y, int col)
 {
     msg = msg.ToUpper();
     for (int i = 0; i < msg.Length; i++)
     {
         int ix = chars.IndexOf(msg[i]);
         if (ix >= 0)
         {
             screen.render(x + i * 8, y, ix + 30 * 32, col, 0);
         }
     }
 }
示例#19
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int col = ColorHelper.get(10, 30, 151, level.grassColor);
            int barkCol1 = ColorHelper.get(10, 30, 430, level.grassColor);
            int barkCol2 = ColorHelper.get(10, 30, 320, level.grassColor);

            bool u = level.getTile(x, y - 1) == this;
            bool l = level.getTile(x - 1, y) == this;
            bool r = level.getTile(x + 1, y) == this;
            bool d = level.getTile(x, y + 1) == this;
            bool ul = level.getTile(x - 1, y - 1) == this;
            bool ur = level.getTile(x + 1, y - 1) == this;
            bool dl = level.getTile(x - 1, y + 1) == this;
            bool dr = level.getTile(x + 1, y + 1) == this;

            if (u && ul && l)
            {
                screen.render(x * 16 + 0, y * 16 + 0, 10 + 1 * 32, col, 0);
            }
            else
            {
                screen.render(x * 16 + 0, y * 16 + 0, 9 + 0 * 32, col, 0);
            }
            if (u && ur && r)
            {
                screen.render(x * 16 + 8, y * 16 + 0, 10 + 2 * 32, barkCol2, 0);
            }
            else
            {
                screen.render(x * 16 + 8, y * 16 + 0, 10 + 0 * 32, col, 0);
            }
            if (d && dl && l)
            {
                screen.render(x * 16 + 0, y * 16 + 8, 10 + 2 * 32, barkCol2, 0);
            }
            else
            {
                screen.render(x * 16 + 0, y * 16 + 8, 9 + 1 * 32, barkCol1, 0);
            }
            if (d && dr && r)
            {
                screen.render(x * 16 + 8, y * 16 + 8, 10 + 1 * 32, col, 0);
            }
            else
            {
                screen.render(x * 16 + 8, y * 16 + 8, 10 + 3 * 32, barkCol2, 0);
            }
        }
示例#20
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            wRandom = new Random((int)((tickCount + (x / 2 - y) * 4311) / 10 * 54687121L + x * 3271612L + y * 3412987161L));
            //TODO: wRandom.setSeed((tickCount + (x / 2 - y) * 4311) / 10 * 54687121L + x * 3271612L + y * 3412987161L);
            int col = ColorHelper.get(500, 500, 520, 550);
            int transitionColor1 = ColorHelper.get(3, 500, level.dirtColor - 111, level.dirtColor);
            int transitionColor2 = ColorHelper.get(3, 500, level.sandColor - 110, level.sandColor);

            bool u = !level.getTile(x, y - 1).connectsToLava;
            bool d = !level.getTile(x, y + 1).connectsToLava;
            bool l = !level.getTile(x - 1, y).connectsToLava;
            bool r = !level.getTile(x + 1, y).connectsToLava;

            bool su = u && level.getTile(x, y - 1).connectsToSand;
            bool sd = d && level.getTile(x, y + 1).connectsToSand;
            bool sl = l && level.getTile(x - 1, y).connectsToSand;
            bool sr = r && level.getTile(x + 1, y).connectsToSand;

            if (!u && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 0, wRandom.nextInt(4), col, wRandom.nextInt(4));
            }
            else
                screen.render(x * 16 + 0, y * 16 + 0, (l ? 14 : 15) + (u ? 0 : 1) * 32, (su || sl) ? transitionColor2 : transitionColor1, 0);

            if (!u && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 0, wRandom.nextInt(4), col, wRandom.nextInt(4));
            }
            else
                screen.render(x * 16 + 8, y * 16 + 0, (r ? 16 : 15) + (u ? 0 : 1) * 32, (su || sr) ? transitionColor2 : transitionColor1, 0);

            if (!d && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 8, wRandom.nextInt(4), col, wRandom.nextInt(4));
            }
            else
                screen.render(x * 16 + 0, y * 16 + 8, (l ? 14 : 15) + (d ? 2 : 1) * 32, (sd || sl) ? transitionColor2 : transitionColor1, 0);
            if (!d && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 8, wRandom.nextInt(4), col, wRandom.nextInt(4));
            }
            else
                screen.render(x * 16 + 8, y * 16 + 8, (r ? 16 : 15) + (d ? 2 : 1) * 32, (sd || sr) ? transitionColor2 : transitionColor1, 0);
        }
示例#21
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int col = ColorHelper.get(111, 111, 110, 110);
            int transitionColor1 = ColorHelper.get(3, 111, level.dirtColor - 111, level.dirtColor);
            int transitionColor2 = ColorHelper.get(3, 111, level.sandColor - 110, level.sandColor);

            bool u = !level.getTile(x, y - 1).connectsToLiquid();
            bool d = !level.getTile(x, y + 1).connectsToLiquid();
            bool l = !level.getTile(x - 1, y).connectsToLiquid();
            bool r = !level.getTile(x + 1, y).connectsToLiquid();

            bool su = u && level.getTile(x, y - 1).connectsToSand;
            bool sd = d && level.getTile(x, y + 1).connectsToSand;
            bool sl = l && level.getTile(x - 1, y).connectsToSand;
            bool sr = r && level.getTile(x + 1, y).connectsToSand;

            if (!u && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 0, 0, col, 0);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 0, (l ? 14 : 15) + (u ? 0 : 1) * 32, (su || sl) ? transitionColor2 : transitionColor1, 0);

            if (!u && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 0, 1, col, 0);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 0, (r ? 16 : 15) + (u ? 0 : 1) * 32, (su || sr) ? transitionColor2 : transitionColor1, 0);

            if (!d && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 8, 2, col, 0);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 8, (l ? 14 : 15) + (d ? 2 : 1) * 32, (sd || sl) ? transitionColor2 : transitionColor1, 0);
            if (!d && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 8, 3, col, 0);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 8, (r ? 16 : 15) + (d ? 2 : 1) * 32, (sd || sr) ? transitionColor2 : transitionColor1, 0);
        }
示例#22
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int col = ColorHelper.get(level.grassColor, level.grassColor, level.grassColor + 111, level.grassColor + 111);
            int transitionColor = ColorHelper.get(level.grassColor - 111, level.grassColor, level.grassColor + 111, level.dirtColor);

            bool u = !level.getTile(x, y - 1).connectsToGrass;
            bool d = !level.getTile(x, y + 1).connectsToGrass;
            bool l = !level.getTile(x - 1, y).connectsToGrass;
            bool r = !level.getTile(x + 1, y).connectsToGrass;

            if (!u && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 0, 0, col, 0);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 0, (l ? 11 : 12) + (u ? 0 : 1) * 32, transitionColor, 0);

            if (!u && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 0, 1, col, 0);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 0, (r ? 13 : 12) + (u ? 0 : 1) * 32, transitionColor, 0);

            if (!d && !l)
            {
                screen.render(x * 16 + 0, y * 16 + 8, 2, col, 0);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 8, (l ? 11 : 12) + (d ? 2 : 1) * 32, transitionColor, 0);
            if (!d && !r)
            {
                screen.render(x * 16 + 8, y * 16 + 8, 3, col, 0);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 8, (r ? 13 : 12) + (d ? 2 : 1) * 32, transitionColor, 0);
        }
示例#23
0
        public override void render(Screen screen)
        {
            Font.renderFrame(screen, "Have", 12, 1, 19, 3);
            Font.renderFrame(screen, "Cost", 12, 4, 19, 11);
            Font.renderFrame(screen, "Crafting", 0, 1, 11, 11);
            renderItemList(screen, 0, 1, 11, 11, recipes, selected);

            if (recipes.size() > 0)
            {
                Recipe recipe = recipes.get(selected);
                int hasResultItems = player.inventory.count(recipe.resultTemplate);
                int xo = 13 * 8;
                screen.render(xo, 2 * 8, recipe.resultTemplate.getSprite(), recipe.resultTemplate.getColor(), 0);
                Font.draw("" + hasResultItems, screen, xo + 8, 2 * 8, ColorHelper.get(-1, 555, 555, 555));

                List<Item> costs = recipe.costs;
                for (int i = 0; i < costs.size(); i++)
                {
                    Item item = costs.get(i);
                    int yo = (5 + i) * 8;
                    screen.render(xo, yo, item.getSprite(), item.getColor(), 0);
                    int requiredAmt = 1;
                    if (item is ResourceItem)
                    {
                        requiredAmt = ((ResourceItem)item).count;
                    }
                    int has = player.inventory.count(item);
                    int color = ColorHelper.get(-1, 555, 555, 555);
                    if (has < requiredAmt)
                    {
                        color = ColorHelper.get(-1, 222, 222, 222);
                    }
                    if (has > 99) has = 99;
                    Font.draw("" + requiredAmt + "/" + has, screen, xo + 8, yo, color);
                }
            }
            // renderItemList(screen, 12, 4, 19, 11, recipes.get(selected).costs, -1);
        }
示例#24
0
 public override void render(Screen screen, Level level, int x, int y)
 {
     onType.render(screen, level, x, y);
     int col = ColorHelper.get(10, 40, 50, -1);
     screen.render(x * 16 + 4, y * 16 + 4, 11 + 3 * 32, col, 0);
 }
示例#25
0
        public override void render(Screen screen)
        {
            int xt = 0;
            int yt = 14;

            int flip1 = (walkDist >> 3) & 1;
            int flip2 = (walkDist >> 3) & 1;

            if (dir == 1)
            {
                xt += 2;
            }
            if (dir > 1)
            {

                flip1 = 0;
                flip2 = ((walkDist >> 4) & 1);
                if (dir == 2)
                {
                    flip1 = 1;
                }
                xt += 4 + ((walkDist >> 3) & 1) * 2;
            }

            int xo = x - 8;
            int yo = y - 11;

            int col = ColorHelper.get(-1, 10, 252, 050);
            if (lvl == 2) col = ColorHelper.get(-1, 100, 522, 050);
            if (lvl == 3) col = ColorHelper.get(-1, 111, 444, 050);
            if (lvl == 4) col = ColorHelper.get(-1, 000, 111, 020);
            if (hurtTime > 0)
            {
                col = ColorHelper.get(-1, 555, 555, 555);
            }

            screen.render(xo + 8 * flip1, yo + 0, xt + yt * 32, col, flip1);
            screen.render(xo + 8 - 8 * flip1, yo + 0, xt + 1 + yt * 32, col, flip1);
            screen.render(xo + 8 * flip2, yo + 8, xt + (yt + 1) * 32, col, flip2);
            screen.render(xo + 8 - 8 * flip2, yo + 8, xt + 1 + (yt + 1) * 32, col, flip2);
        }
示例#26
0
 public override void renderIcon(Screen screen, int x, int y, int bits = 0)
 {
     screen.render(x, y, resource.sprite, resource.color, bits);
 }
示例#27
0
        public override void render(Screen screen)
        {
            int xt = 8;
            int yt = 14;

            int flip1 = (walkDist >> 3) & 1;
            int flip2 = (walkDist >> 3) & 1;

            if (dir == 1)
            {
                xt += 2;
            }
            if (dir > 1)
            {

                flip1 = 0;
                flip2 = ((walkDist >> 4) & 1);
                if (dir == 2)
                {
                    flip1 = 1;
                }
                xt += 4 + ((walkDist >> 3) & 1) * 2;
            }

            int xo = x - 8;
            int yo = y - 11;

            int col1 = ColorHelper.get(-1, 100, 500, 555);
            int col2 = ColorHelper.get(-1, 100, 500, 532);
            if (health < 200)
            {
                if (tickTime / 3 % 2 == 0)
                {
                    col1 = ColorHelper.get(-1, 500, 100, 555);
                    col2 = ColorHelper.get(-1, 500, 100, 532);
                }
            }
            else if (health < 1000)
            {
                if (tickTime / 5 % 4 == 0)
                {
                    col1 = ColorHelper.get(-1, 500, 100, 555);
                    col2 = ColorHelper.get(-1, 500, 100, 532);
                }
            }
            if (hurtTime > 0)
            {
                col1 = ColorHelper.get(-1, 555, 555, 555);
                col2 = ColorHelper.get(-1, 555, 555, 555);
            }

            screen.render(xo + 8 * flip1, yo + 0, xt + yt * 32, col1, flip1);
            screen.render(xo + 8 - 8 * flip1, yo + 0, xt + 1 + yt * 32, col1, flip1);
            screen.render(xo + 8 * flip2, yo + 8, xt + (yt + 1) * 32, col2, flip2);
            screen.render(xo + 8 - 8 * flip2, yo + 8, xt + 1 + (yt + 1) * 32, col2, flip2);
        }
示例#28
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int col = ColorHelper.get(444, 444, 555, 555);
            int transitionColor = ColorHelper.get(333, 444, 555, -1);

            bool u = level.getTile(x, y - 1) == Tile.infiniteFall;
            bool d = level.getTile(x, y + 1) == Tile.infiniteFall;
            bool l = level.getTile(x - 1, y) == Tile.infiniteFall;
            bool r = level.getTile(x + 1, y) == Tile.infiniteFall;

            bool ul = level.getTile(x - 1, y - 1) == Tile.infiniteFall;
            bool dl = level.getTile(x - 1, y + 1) == Tile.infiniteFall;
            bool ur = level.getTile(x + 1, y - 1) == Tile.infiniteFall;
            bool dr = level.getTile(x + 1, y + 1) == Tile.infiniteFall;

            if (!u && !l)
            {
                if (!ul)
                    screen.render(x * 16 + 0, y * 16 + 0, 17, col, 0);
                else
                    screen.render(x * 16 + 0, y * 16 + 0, 7 + 0 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 0, (l ? 6 : 5) + (u ? 2 : 1) * 32, transitionColor, 3);

            if (!u && !r)
            {
                if (!ur)
                    screen.render(x * 16 + 8, y * 16 + 0, 18, col, 0);
                else
                    screen.render(x * 16 + 8, y * 16 + 0, 8 + 0 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 0, (r ? 4 : 5) + (u ? 2 : 1) * 32, transitionColor, 3);

            if (!d && !l)
            {
                if (!dl)
                    screen.render(x * 16 + 0, y * 16 + 8, 20, col, 0);
                else
                    screen.render(x * 16 + 0, y * 16 + 8, 7 + 1 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 8, (l ? 6 : 5) + (d ? 0 : 1) * 32, transitionColor, 3);
            if (!d && !r)
            {
                if (!dr)
                    screen.render(x * 16 + 8, y * 16 + 8, 19, col, 0);
                else
                    screen.render(x * 16 + 8, y * 16 + 8, 8 + 1 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 8, (r ? 4 : 5) + (d ? 0 : 1) * 32, transitionColor, 3);
        }
示例#29
0
        public override void render(Screen screen, Level level, int x, int y)
        {
            int col = ColorHelper.get(334, 334, 223, 223);
            int transitionColor = ColorHelper.get(001, 334, 445, level.dirtColor);

            bool u = level.getTile(x, y - 1) != this;
            bool d = level.getTile(x, y + 1) != this;
            bool l = level.getTile(x - 1, y) != this;
            bool r = level.getTile(x + 1, y) != this;

            bool ul = level.getTile(x - 1, y - 1) != this;
            bool dl = level.getTile(x - 1, y + 1) != this;
            bool ur = level.getTile(x + 1, y - 1) != this;
            bool dr = level.getTile(x + 1, y + 1) != this;

            if (!u && !l)
            {
                if (!ul)
                    screen.render(x * 16 + 0, y * 16 + 0, 0, col, 0);
                else
                    screen.render(x * 16 + 0, y * 16 + 0, 7 + 0 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 0, (l ? 6 : 5) + (u ? 2 : 1) * 32, transitionColor, 3);

            if (!u && !r)
            {
                if (!ur)
                    screen.render(x * 16 + 8, y * 16 + 0, 1, col, 0);
                else
                    screen.render(x * 16 + 8, y * 16 + 0, 8 + 0 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 0, (r ? 4 : 5) + (u ? 2 : 1) * 32, transitionColor, 3);

            if (!d && !l)
            {
                if (!dl)
                    screen.render(x * 16 + 0, y * 16 + 8, 2, col, 0);
                else
                    screen.render(x * 16 + 0, y * 16 + 8, 7 + 1 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 0, y * 16 + 8, (l ? 6 : 5) + (d ? 0 : 1) * 32, transitionColor, 3);
            if (!d && !r)
            {
                if (!dr)
                    screen.render(x * 16 + 8, y * 16 + 8, 3, col, 0);
                else
                    screen.render(x * 16 + 8, y * 16 + 8, 8 + 1 * 32, transitionColor, 3);
            }
            else
                screen.render(x * 16 + 8, y * 16 + 8, (r ? 4 : 5) + (d ? 0 : 1) * 32, transitionColor, 3);
        }
示例#30
0
        public override void render(Screen screen)
        {
            int xt = 0;
            int yt = 14;

            int flip1 = (walkDist >> 3) & 1;
            int flip2 = (walkDist >> 3) & 1;

            if (dir == 1)
            {
                xt += 2;
            }
            if (dir > 1)
            {
                flip1 = 0;
                flip2 = ((walkDist >> 4) & 1);
                if (dir == 2)
                {
                    flip1 = 1;
                }
                xt += 4 + ((walkDist >> 3) & 1) * 2;
            }

            int xo = x - 8;
            int yo = y - 11;
            if (isSwimming())
            {
                yo += 4;
                int waterColor = ColorHelper.get(-1, -1, 115, 335);
                if (tickTime / 8 % 2 == 0)
                {
                    waterColor = ColorHelper.get(-1, 335, 5, 115);
                }
                screen.render(xo + 0, yo + 3, 5 + 13 * 32, waterColor, 0);
                screen.render(xo + 8, yo + 3, 5 + 13 * 32, waterColor, 1);
            }

            if (attackTime > 0 && attackDir == 1)
            {
                screen.render(xo + 0, yo - 4, 6 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 0);
                screen.render(xo + 8, yo - 4, 6 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 1);
                if (attackItem != null)
                {
                    attackItem.renderIcon(screen, xo + 4, yo - 4);
                }
            }
            int col = ColorHelper.get(-1, 100, 220, 532);
            if (hurtTime > 0)
            {
                col = ColorHelper.get(-1, 555, 555, 555);
            }

            if (activeItem is FurnitureItem)
            {
                yt += 2;
            }
            screen.render(xo + 8 * flip1, yo + 0, xt + yt * 32, col, flip1);
            screen.render(xo + 8 - 8 * flip1, yo + 0, xt + 1 + yt * 32, col, flip1);
            if (!isSwimming())
            {
                screen.render(xo + 8 * flip2, yo + 8, xt + (yt + 1) * 32, col, flip2);
                screen.render(xo + 8 - 8 * flip2, yo + 8, xt + 1 + (yt + 1) * 32, col, flip2);
            }

            if (attackTime > 0 && attackDir == 2)
            {
                screen.render(xo - 4, yo, 7 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 1);
                screen.render(xo - 4, yo + 8, 7 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 3);
                if (attackItem != null)
                {
                    attackItem.renderIcon(screen, xo - 4, yo + 4, Screen.BIT_MIRROR_X);
                }
            }
            if (attackTime > 0 && attackDir == 3)
            {
                screen.render(xo + 8 + 4, yo, 7 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 0);
                screen.render(xo + 8 + 4, yo + 8, 7 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 2);
                if (attackItem != null)
                {
                    attackItem.renderIcon(screen, xo + 8 + 4, yo + 4);
                }
            }
            if (attackTime > 0 && attackDir == 0)
            {
                screen.render(xo + 0, yo + 8 + 4, 6 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 2);
                screen.render(xo + 8, yo + 8 + 4, 6 + 13 * 32, ColorHelper.get(-1, 555, 555, 555), 3);
                if (attackItem != null)
                {
                    attackItem.renderIcon(screen, xo + 4, yo + 8 + 4, Screen.BIT_MIRROR_X | Screen.BIT_MIRROR_Y);
                }
            }

            if (activeItem is FurnitureItem)
            {
                Furniture furniture = ((FurnitureItem)activeItem).furniture;
                furniture.x = x;
                furniture.y = yo;
                furniture.render(screen);

            }
        }
示例#31
0
 public override void renderInventory(Screen screen, int x, int y)
 {
     screen.render(x, y, getSprite(), getColor(), 0);
     Font.draw(getName(), screen, x + 8, y, ColorHelper.get(-1, 555, 555, 555));
 }
示例#32
0
 public override void renderIcon(Screen screen, int x, int y, int bits = 0)
 {
     screen.render(x, y, getSprite(), getColor(), bits);
 }