コード例 #1
0
ファイル: LeafGenerator.cs プロジェクト: Loktor/MonkeyJump
 public Leaf CreateRandomLeaf()
 {
     Leaf leaf = new Leaf();
     GameManager gameManager = GameManager.Instance;
     leaf.texture = gameManager.ResourceManager.RetreiveTexture(ResourceManager.LEAF_PATH);
     leaf.Init(gameManager.GameBounds);
     return leaf;
 }
コード例 #2
0
ファイル: LeafGenerator.cs プロジェクト: Loktor/MonkeyJump
        public Banana CreateRandomBanana(Leaf leaf)
        {
            Banana banana = new Banana(leaf.Direction);
            GameManager gameManager = GameManager.Instance;
            banana.texture = gameManager.ResourceManager.RetreiveTexture(ResourceManager.BANANA_PATH);
            banana.Init(gameManager.GameBounds);

            banana.position.X = leaf.Direction == Direction.Left ? leaf.position.X - 30 + leaf.FrameSize.Width - 30 : leaf.position.X + 30;
            banana.position.Y -= 10; // to position the banana directly on the leave
            banana.SpriteEffects = leaf.SpriteEffects;
            return banana;
        }