Exemple #1
0
        public MasterMindBoard()
            : base()
        {
            SetStaticObject(true);
            SetTexture("mm_board");
            SetSize(12.0f, 10.0f);
            Z_Index = 100;
            gridAttempts.DisableSizing = true;
            gridAttempts.SetPos(-0.90f, -1.55f);
            gridAttempts.SetSize(3.85f, 8.66f);

            gridOutput.DisableSizing = true;
            gridOutput.SetPos(4.60f, -0.7f);
            gridOutput.SetSize(1f, 8.66f);

            gridAwnser.DisableSizing = true;
            gridAwnser.SetPos(-0.90f, 9.65f);
            gridAwnser.SetSize(3.85f, 1.06f);

            Reset();
            TomatoMainEngine.AddGameObject(gridAttempts);
            TomatoMainEngine.AddGameObject(gridOutput);
            TomatoMainEngine.AddGameObject(gridAwnser);
            SelectPawn(0, 0);

            MakeCodeToCrack();
            ShowAwnser();
        }
Exemple #2
0
 private void LaunchTheFireWorks()
 {
     for (int i = 0; i < 4; i++)
     {
         TomatoMainEngine.AddGameObject(new TimedFireworks.FireWork(new PointFloat(0, -20), Pawn.ConvertPawnColor(_codeToCrack[i])));
     }
 }
        public Particle(ImageTexture texture, float x, float y, float _rotation, float speed, int lifetime, float sizex, float sizey, byte[] color, int parent, bool physics, bool mass) : base()
        {
            Type = "Particle.Particle";
            SetSize(sizex, sizey);
            SetTexture(texture);
            _lifeTime = lifetime;
            SetRotation(_rotation);
            SetPos(x, y);
            _speed = speed;
            EnablePhysics(physics);
            SetStaticObject(false);
            EnableAirResistance(false);
            SetIsParticle(true);
            HasMass(mass);
            float xAdd = (float)Math.Sin((double)GetRotation());
            float yAdd = (float)Math.Cos((double)GetRotation());

            SetVelocity(xAdd * _speed, yAdd * _speed);
            SetPhysSize(0.1f);
            SetColor(color);
            _parent = parent;
            if (parent != 0)
            {
                Z_Index = TomatoMainEngine.GetRenderObject(_parent).Z_Index - 1;
            }
            else
            {
                Z_Index = 999999999;
            }
        }
 public override void Update(GameSettings settings)
 {
     base.Update(settings);
     time--;
     SetVelocityAdd(0f, -0.007f);
     _smoke.SetPos(GetPosition());
     _smoke.SetRot(GetRotation());
     _smoke.Blow(0.01f, 1, false);
     if (time - 1 < 0)
     {
         SoundPool.PlaySound("explode");
         SetTexture("light");
         SetSize(1.0f, 1.0f);
     }
     if (time < 0)
     {
         if (Explode)
         {
             _explosion.SetColor(_color);
             _explosion.SetPos(GetPosition());
             _explosion.Blow(0.1f, 40, false);
         }
         TomatoMainEngine.RemoveRenderObject(EntityId);
     }
 }
Exemple #5
0
 //Build the level / init map / add player etc
 public override void Build(TomatoMainEngine engine)
 {
     //SoundPool.PlayBackgroundMusic("ComeandFindMe");
     //SoundPool.PlayBackgroundMusic("Arpanauts");
     _cannons.Add(new TimedCannon(-10f,-15f,new int[5]{1000,2000,3000,4000,5000}));
     _cannons.Add(new TimedCannon(10f, -15f, new int[5] { 1000, 2000, 3000, 4000, 5000 }));
     PhysEngine.Mode = PhysMode.CircleBox;
 }
        public void Blow(float speed, bool mass)
        {
            if (_ransomSpeed)
            {
                speed = RandomSpread(speed, _speedSpread);
            }
            Particle p = new Particle(_texture, _pos.x, _pos.y, RandomSpread(_rot, _spread), speed, _random.Next(_minlifetime, _maxlifetime), _size.x, _size.y, _color, _parent, _phys, mass);

            TomatoMainEngine.AddGameObject(p);
        }
 public override void Update(GameSettings settings)
 {
     _lifeTime = _lifeTime - 1;
     if (_lifeTime < 0)
     {
         _lifeTime = 0;
         TomatoMainEngine.RemoveRenderObject(EntityId);
     }
     SetRotation(GetVelocity().GetDirection());
     base.Update(settings);
 }
 //Build the level / init map / add player etc
 public override void Build(TomatoMainEngine engine)
 {
     //SoundPool.PlayBackgroundMusic("ComeandFindMe");
     //SoundPool.PlayBackgroundMusic("Arpanauts");
     _cannons.Add(new TimedCannon(-10f, -15f, new int[5] {
         1000, 2000, 3000, 4000, 5000
     }));
     _cannons.Add(new TimedCannon(10f, -15f, new int[5] {
         1000, 2000, 3000, 4000, 5000
     }));
     PhysEngine.Mode = PhysMode.CircleBox;
 }
Exemple #9
0
 public override void Update(GameSettings settings)
 {
     base.Update(settings);
     if (_parentId != 0)
     {
         GameObject parent = TomatoMainEngine.GetRenderObject(_parentId);
         SetPos(parent.GetPosition());
         SetRotation(parent.GetRotation());
         _vertexPos.X    = GetPosition().x;
         _vertexPos.Y    = GetPosition().y;
         _vertexPos.Z    = 1;
         _light.Position = _vertexPos;
     }
 }
 public override void Build(TomatoMainEngine engine)
 {
     base.Build(engine);
     engine.SetSize(600,600);
     engine.LockSize(true);
     SoundPool.PlayBackgroundMusic("Arpanauts");
     var firstBackground = new GameObject();
     firstBackground.SetTexture("sunset");
     firstBackground.SetSize(30,20);
     firstBackground.Z_Index = -1;
     TomatoMainEngine.AddGameObject(firstBackground);
     var background = new SoundBoard.Waves();
     background.SetPos(0f,-15f);
     background.SetHeight(30);
     background.SetSize(60,0);
     background.Z_Index = 1;
     TomatoMainEngine.AddGameObject(background);
     TomatoMainEngine.AddGameObject(new MasterMindBoard());
 }
Exemple #11
0
        public override void Build(TomatoMainEngine engine)
        {
            base.Build(engine);
            engine.SetSize(600, 600);
            engine.LockSize(true);
            SoundPool.PlayBackgroundMusic("Arpanauts");
            var firstBackground = new GameObject();

            firstBackground.SetTexture("sunset");
            firstBackground.SetSize(30, 20);
            firstBackground.Z_Index = -1;
            TomatoMainEngine.AddGameObject(firstBackground);
            var background = new SoundBoard.Waves();

            background.SetPos(0f, -15f);
            background.SetHeight(30);
            background.SetSize(60, 0);
            background.Z_Index = 1;
            TomatoMainEngine.AddGameObject(background);
            TomatoMainEngine.AddGameObject(new MasterMindBoard());
        }
Exemple #12
0
 public override void Build(TomatoMainEngine engine)
 {
     base.Build(engine);
     for (int x = 0; x < 100; x++)
     {
         for (int y = 0; y < 100; y++)
         {
             if (y == 0)
             {
                 var b = new FrontView2D.World.GroundTile((float)x * 2 - 50, (float)-y * 2, 1f, 1f, "grass");
                 //b.SetRotation((float)(Math.PI / 2 * _r.Next(0, 4)));
                 TomatoMainEngine.AddGameObject(b);
             }
             else
             {
                 var b = new FrontView2D.World.GroundTile((float)x * 2 - 50, (float)-y * 2, 1f, 1f, "ground");
                 b.SetRotation((float)(Math.PI / 2 * _r.Next(0, 4)));
                 TomatoMainEngine.AddGameObject(b);
             }
         }
     }
 }
Exemple #13
0
        public override void Build(TomatoMainEngine engine)
        {
            base.Build(engine);
            for ( int x = 0; x < 100; x++)
            {
                for ( int y = 0; y < 100; y++ )
                {
                    if(y == 0){
                        var b = new FrontView2D.World.GroundTile((float)x*2 - 50, (float)-y*2, 1f, 1f, "grass");
                        //b.SetRotation((float)(Math.PI / 2 * _r.Next(0, 4)));
                        TomatoMainEngine.AddGameObject(b);
                    }
                    else
                    {
                        var b = new FrontView2D.World.GroundTile((float)x*2 - 50, (float)-y*2, 1f, 1f, "ground");
                        b.SetRotation((float)(Math.PI / 2 * _r.Next(0, 4)));
                        TomatoMainEngine.AddGameObject(b);
                    }

                }
            }
        }
Exemple #14
0
 public void Add(GameObject obj, int row, int col)
 {
     _objects[row, col] = obj;
     TomatoMainEngine.AddGameObject(obj);
 }