Esempio n. 1
0
 public void addObjects(GameObject[] objs)
 {
     foreach(GameObject obj in objs)
         List.Add(obj);
 }
Esempio n. 2
0
        protected void InitializeGameObjects()
        {
            collider = new Collider();
            //ingame object init

            plane = new DenseGameObject(new Vector2(0, 0), planeImage);
            ahouse = new DenseGameObject(new Vector2(0, 0), houseImage);

            //decorations
            sky = new GameObject(new Vector2(0, 0), skyImage);
            farcity = new GameObject(new Vector2(0, 5), cityImage);
            farcityTwin = new GameObject(new Vector2(screenWidth, 5), cityImage);

            farcity.Speed = new Vector2(-nspeed(40),0);
            farcityTwin.Speed = new Vector2(-nspeed(40), 0);

            //layers init
            gameLayers.Add("plane", new GameLayer());
            gameLayers.Add("sky", new GameLayer());
            gameLayers.Add("farcity", new GameLayer());

            gameLayers["plane"].Level = 0.8f;
            gameLayers["farcity"].Level = 0.5f;
            gameLayers["sky"].Level = 0.0f;

            gameLayers["plane"].addObject(plane);
            gameLayers["plane"].addObject(ahouse);

            gameLayers["sky"].addObject(sky);
            gameLayers["farcity"].addObject(farcity);
            gameLayers["farcity"].addObject(farcityTwin);

            //add dense objects to the collider
            collider.addObject(plane);
            collider.addObject(ahouse);

            plane.Scale = 0.4f;
        }
Esempio n. 3
0
 public void addObject(GameObject obj)
 {
     List.Add(obj);
 }