Ejemplo n.º 1
0
        protected override void LoadMap()
        {
            map = new TileMap(content.Load <TiledMap>("TileMaps//level0/Level0-map"), graphics);

            Paralax p1 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p2"), graphics, Vector2.Zero, new Vector2((float)0.2, 0));
            Paralax p2 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p1"), graphics, new Vector2(-1, 0), new Vector2((float)0.5, (float)0.9));
            Paralax p3 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p0"), graphics, Vector2.Zero, new Vector2((float)0.4, (float)0.1));
            Paralax p4 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p3"), graphics, Vector2.Zero, new Vector2((float)0.3, (float)0));

            _paralaxes.Add(p1);
            _paralaxes.Add(p4);
            _paralaxes.Add(p3);
            _paralaxes.Add(p2);
        }
Ejemplo n.º 2
0
        protected override void LoadMap()
        {
            map = new TileMap(content.Load <TiledMap>("TileMaps//level3/Level3-map"), graphics);


            Paralax p1 = new Paralax(content.Load <Texture2D>("Backgrounds/Level3/l3p1"), graphics, Vector2.Zero, new Vector2((float)0.5, 0));
            Paralax p3 = new Paralax(content.Load <Texture2D>("Backgrounds/Level3/l3p2"), graphics, Vector2.Zero, new Vector2((float)0.2, (float)0));

            _paralaxes.Add(p3);
            _paralaxes.Add(p1);


            effect        = content.Load <Effect>("shaders/lightEffect");
            isLightShader = true;
        }
Ejemplo n.º 3
0
    private void Start()
    {
        am = FindObjectOfType <AudioManager>();
        cl = FindObjectOfType <CanvasLife>();
        pl = FindObjectOfType <Paralax>();

        foreach (WallMaterial w in FindObjectsOfType <WallMaterial>())
        {
            if (w.transform.position.x < 0)//left walls belong to player 1 and right walls to player 2
            {
                wallsPlayerOne.Add(w);
            }
            else
            {
                wallsPlayerTwo.Add(w);
            }
        }
        ///////////////////////////////
        GameEvents.OnGameStart.AddListener(SetNewGame);
        GameEvents.OnGameEnd.AddListener(StopGame);
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        Transform T = Instantiate(paralaxContainer).transform;

        T.parent        = transform;
        T.localPosition = T.localPosition = new Vector3(1, paralaxContainer.transform.localPosition.y, 0);
        T.localScale    = paralaxContainer.transform.localScale;

        T               = Instantiate(paralaxContainer).transform;
        T.parent        = transform;
        T.localPosition = T.localPosition = new Vector3(-1, paralaxContainer.transform.localPosition.y, 0);
        T.localScale    = paralaxContainer.transform.localScale;

        startPosition = transform.position.x;
        length        = GetComponent <SpriteRenderer>().bounds.size.x;
        cameraPlayer  = FindObjectOfType <Camera2D>().transform;

        eParalax = transform.Find("eParalax");
        sParalax = transform.Find("sParalax");

        l = Paralax.SetarLimits();
        Debug.Log(length);
    }
Ejemplo n.º 5
0
 private void Awake()
 {
     bm = FindObjectOfType <BuildingManager>();
     pl = FindObjectOfType <Paralax>();
     GameEvents.OnGameStart.AddListener(SetLifeImages);
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     current = this;
 }