Esempio n. 1
0
        public void Draw(SpriteBatch batch, GameWindow window)
        {
            batch.Draw(_evilOMeter, new Vector2(360, 20), Color.White);
            batch.Draw(_goodOMeter, new Vector2(360, 20), new Rectangle(0, 0, 93 + HOW_EVIL, _evilOMeter.Height), Color.White);

            if (_heldObject != null)
            {
                if (_heldObject.Disposed)
                {
                    _heldObject = null;
                }
                else if(_heldObject.CapturedSprite != null)
                {
                    batch.Draw(_heldObject.CapturedSprite.Texture, new Vector2((float)window.ClientBounds.Width - 165, (float)window.ClientBounds.Height - 190), Color.White);
                }
                else if (_heldObject.Sprite.Animation != null)
                {
                    _heldObject.Sprite.Animation.Draw(batch, new Vector2((float)window.ClientBounds.Width / 2, (float)window.ClientBounds.Height - 50), 0f, false);
                }
                else
                {
                    batch.Draw(_heldObject.Sprite.Texture, new Vector2((float)window.ClientBounds.Width / 2, (float)window.ClientBounds.Height - 50), Color.White);
                }
            }
        }
Esempio n. 2
0
        public Reaper(GameObject reaper, EffectManager _effectManager, GameObject baby)
        {
            this._reaper = reaper;
            this._baby = baby;
            this._effectManager = _effectManager;

            _reaper.Body.Position = new Vector2(100, 100);
        }
Esempio n. 3
0
 public bool IsFlipped(GameObject gameObject)
 {
     if (_baby.Body.Position.X - gameObject.Body.Position.X > 0)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
Esempio n. 4
0
 public void Apply(GameObject collider, GameObject good, GameObject evil)
 {
     if (collider.Reward.GoodPoints > 0)
     {
         good.Statistics.CollectItem(good, collider.Reward.GetAgnosticPoints());
         HeadsUpDisplay.HOW_EVIL += collider.Reward.GoodPoints;
     }
     else
     {
         evil.Statistics.CollectItem(evil, collider.Reward.GetAgnosticPoints());
         HeadsUpDisplay.HOW_EVIL -= collider.Reward.EvilPoints;
     }
 }
Esempio n. 5
0
        public GameMenu(ContentManager content, GameInstance gameInstance, GameObject devil, GameObject angel)
        {
            _font = content.Load<SpriteFont>("Courier New");
            _title = content.Load<Texture2D>("title");
            _selectionBad = content.Load<Texture2D>("badpic");
            _selectionGod = content.Load<Texture2D>("godpic");
            _background = content.Load<Texture2D>("main");
            this.devil = devil;
            this.angel = angel;

            _titlePosition = new Vector2(300, 100);
            _selectionPosition = new Vector2(565-_selectionOffset, 250);
            _gameInstance = gameInstance;
        }
Esempio n. 6
0
 private Body getCircle(float radius, GameObject _gameobject)
 {
     Body body = BodyFactory.CreateCircle(_world, radius, 1f, new Vector2(5, 5), this);
     body.BodyType = BodyType.Dynamic;
     body.Mass = 5;
     body.OnCollision += OnCollision;
     body.BodyType = BodyType.Dynamic;
     body.UserData = _gameobject;
     body.LinearDamping = 3.5f;
     body.OnCollision += OnCollision;
     return body;
 }
Esempio n. 7
0
 private GameObject GetBase()
 {
     GameObject gameObject = new GameObject();
     _gameObjects.Add(gameObject);
     return gameObject;
 }
Esempio n. 8
0
        public GameObject GetDevil()
        {
            GameObject angel = GetBase();
            angel.Sprite = _renderManager.GetSprite(RenderManager.Texture.DEVIL);
            angel.Body = getCircle(.3f, angel);
            angel.LabelColor = Color.Red;
            angel.Body.Enabled = true;
            evil = angel;
            evil.Statistics = new Stats();

            return angel;
        }
Esempio n. 9
0
 public void Update(GameObject _devil, GameObject _angel)
 {
     //todo->devil.points + angel.points /2 -- 309 * taht
     int percent = (_devil.Statistics.PointsCollected + _angel.Statistics.PointsCollected / 2) * 309;
     //Console.WriteLine("" + percent);
 }
Esempio n. 10
0
 // to
 public void PushItem(GameObject gameObject)
 {
     _heldObject = gameObject;
 }
Esempio n. 11
0
 public void PopItem()
 {
     _heldObject = null;
 }
Esempio n. 12
0
 public void Add(GameObject go)
 {
     _gameObjects.Add(go);
 }
Esempio n. 13
0
        private void CreateBaby()
        {
            _baby = _gameObjectManager.GetBaby();
            _devil = _gameObjectManager.GetDevil();

            _angel = _gameObjectManager.GetAngel();

            jLeftArm = new RopeJoint(_devil.Body, _baby.Body, new Vector2(0f, 0f), new Vector2(-.01f, 0f));
            jLeftArm.MaxLength = 2f;
            _world.AddJoint(jLeftArm);

            jRightArm = new RopeJoint(_angel.Body, _baby.Body, new Vector2(0f, 0f), new Vector2(.01f, 0f));
            jRightArm.MaxLength = 2f;
            _world.AddJoint(jRightArm);

            //_ragdoll = new Ragdoll(_world, _baby.Body, _renderManager);
        }
Esempio n. 14
0
 public void CompleteDeed(GameObject go, int points)
 {
     _deedsDone += 1;
     _pointsCollected += points;
     go.Label = new FloatingScoreLabel("+" + points);
 }
Esempio n. 15
0
 public void CollectItem(GameObject go, int points)
 {
     _itemsCollected += 1;
     _pointsCollected += points;
     go.Label = new FloatingScoreLabel("+" + points);
 }