public override void Initialize() { m_color = Color.Black; scaleMatrix = Matrix.CreateScale(viewport.Width / 800, viewport.Height / 480, 1.0f); TouchPanel.DisplayWidth = 800; TouchPanel.DisplayHeight = 480; TouchPanel.EnableMouseTouchPoint = true; JoystickLeft = new VirtualJoystick(Joystickradial, Joystickthumbnail, new Vector2(100, 400)); JoystickRight = new VirtualJoystick(Joystickradial, Joystickthumbnail, new Vector2(750, 400)); }
public override void Initialize() { JoystickLeft = new VirtualJoystick(Joystickradial, Joystickthumbnail, new Vector2(100, 400)); JoystickRight = new VirtualJoystick(Joystickradial, Joystickthumbnail, new Vector2(750, 400)); Distance = 0; m_deltatime = 0; quadtree = new QuadTree(0, new Rectangle(0, 0, 3508, 2280)); QuadList = new List <QuadTree>(); m_enemies = new List <Enemy>(); m_totalobjects = new List <Pawn>(); ReturnObjects = new List <Pawn>(); m_deathparticles = new List <DeathParticle>(); m_player = new Player(m_playertexture, m_bulletTexture, m_cursorTexture, m_lifeTexture, new Vector2(1445, 982), 2); m_camera = new Camera(GetViewport, m_player); m_border = new Border(m_bordertexture, m_player); m_parallaxBackgrounds = new List <ParallaxBackground>(); m_parallaxBackgrounds.Add(new ParallaxBackground(m_parallaxtexture1, new Vector2(100, 100), .50f, m_player)); m_parallaxBackgrounds.Add(new ParallaxBackground(m_parallaxtexture2, new Vector2(200, 200), .50f, m_player)); m_parallaxBackgrounds.Add(new ParallaxBackground(m_parallaxtexture3, new Vector2(400, 400), .50f, m_player)); m_player.SetFont(font); m_enemyspawners = new List <EnemySpawner>(); m_enemyspawners.Add(new EnemySpawner(m_enemytexture, m_enemychasertexture, new Vector2(-5, -35), .80f, m_player)); m_enemyspawners.Add(new EnemySpawner(m_enemytexture, m_enemychasertexture, new Vector2(3550, -35), .80f, m_player)); m_enemyspawners.Add(new EnemySpawner(m_enemytexture, m_enemychasertexture, new Vector2(3550, 2500), .80f, m_player)); m_enemyspawners.Add(new EnemySpawner(m_enemytexture, m_enemychasertexture, new Vector2(-5, 2500), .80f, m_player)); foreach (EnemySpawner enemySpawner in m_enemyspawners) { enemySpawner.SetCameraMatrix(m_camera.Transform); } }