示例#1
0
        public Menu(SpriteFont font)
        {
            spriteFont = font;


            arrow = new GraphicObj();
            Animation anim = new Animation(Bloodbender.ptr.Content.Load <Texture2D>("arrow"));

            anim.forceDepth(1);
            arrow.addAnimation(anim);
            arrow.checkIsInView = false;
            arrow.scale        /= 1.5f;

            options = new List <string>();
            saves   = new List <string>();

            options.Add("Quit");
            options.Add("New Game");
            if (Bloodbender.ptr.savedSeeds != null)
            {
                options.Add("Load Game");
                foreach (var savedSeed in Bloodbender.ptr.savedSeeds)
                {
                    DateTime dt            = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(savedSeed).ToLocalTime();
                    string   formattedDate = dt.ToString("HH:mm:ss - dd-MM-yyyy");
                    saves.Add(formattedDate);
                }
            }
        }
示例#2
0
        public float angleWith(GraphicObj obj)
        {
            float deltaY = obj.position.Y - position.Y;
            float deltaX = obj.position.X - position.X;

            float angle = (float)(Math.Atan2(deltaY, deltaX));

            return(angle);
        }
示例#3
0
 private void AddTree(float x, float y)
 {
     if (IsPointOutside(x, y))
     {
         var tree = new GraphicObj(OffSet.BottomCenterHorizontal);
         tree.position = new Vector2(x, y) * Bloodbender.meterToPixel;
         tree.addAnimation(new Animation(Bloodbender.ptr.Content.Load <Texture2D>("tree1")));
         int treeScale = rnd.Next(600, 1800);
         tree.scale = new Vector2(treeScale / 1000.0f, treeScale / 1000.0f);
         Bloodbender.ptr.listGraphicObj.Add(tree);
     }
 }
示例#4
0
        public Shadow(GraphicObj graphicObj, Texture2D texture = null) : base(OffSet.Center)
        {
            this.graphicObj = graphicObj;

            if (texture == null)
            {
                addAnimation(new Animation(Bloodbender.ptr.Content.Load <Texture2D>("shadow")));
            }
            else
            {
                addAnimation(new Animation(texture));
            }
        }
示例#5
0
 public MoveTo(GraphicObj obj, List <PathFinderNode> listVect, float speed = 200.0f)
 {
     target     = obj;
     points     = listVect;
     this.speed = speed;
 }