Ejemplo n.º 1
0
    public Wall(Level pLevel) : base("white.png")
    {
        _scrollSpeed = MyGame.GetScrollSpeed();
        _tileSize    = MyGame.GetTileSize();
        _level       = pLevel;
        _length      = Utils.Random(3, 6);

        //false (x = 0), true (x = game.width)
        //_positionX = OurUtils.RandomBool() ? game.width : 0;
        bool test = OurUtils.RandomBool();

        if (test)
        {
            SetOrigin(width, 0);
            _positionX = game.width;
        }
        else
        {
            SetOrigin(0, 0);
            _positionX = 0;
        }
        _positionY = Utils.Random(0, game.height) - game.height;

        x = _positionX;
        y = _positionY;
        //Console.WriteLine(x + " " + y);
        //Console.WriteLine(_positionX + " " + _positionY);
        CreateWall(_length, _positionX, _positionY);
    }
Ejemplo n.º 2
0
 public Road(string filename, Level pLevel) : base(filename)
 {
     _level       = pLevel;
     _scrollSpeed = MyGame.GetScrollSpeed();
     _tileSize    = MyGame.GetTileSize();
     Rescale();
 }
Ejemplo n.º 3
0
    public Level() : base()
    {
        //initialise variables
        _scrollSpeed = MyGame.GetScrollSpeed();
        _tileSize    = MyGame.GetTileSize();

        //Timer initialization
        _lastUpdatedVictimTime = 0;
        _lastUpdatedEnemyTime  = 0;

        //Depth
        _floorLayer  = new LevelLayer();
        _victimLayer = new LevelLayer();
        _poopLayer   = new LevelLayer();
        _flightLayer = new LevelLayer();
        _hudLayer    = new LevelLayer();
        AddChild(_floorLayer);
        AddChild(_victimLayer);
        AddChild(_poopLayer);
        AddChild(_flightLayer);
        AddChild(_hudLayer);

        CreatePlayer();
        CreateRoad();
        //CreateEnemy();
        CreateHUD();
    }
Ejemplo n.º 4
0
 public Victim(Level pLevel) : base("Victim.png", 2, 1)
 {
     currentFrame = 0;
     _scrollSpeed = MyGame.GetScrollSpeed();
     _speed       = _scrollSpeed * 2;
     _level       = pLevel;
     SetOrigin(width / 2, height / 2);
     //x = Utils.Random(width, game.width - width);
 }
Ejemplo n.º 5
0
 //Codename: (pidgeon) poop
 public Projectile(Level pLevel) : base("circle.png")
 {
     //Initialization of variables
     _level = pLevel;
     _distanceFromGround = 0.0f;
     _scrollSpeed        = MyGame.GetScrollSpeed();
     _scale = 0.8f;
     SetOrigin(width / 2, height / 2);
     //SetColor(0.5f, 0.5f, 0.5f);
     //color = 0xffffff;
 }