function TGame(ctx, SceneManager, Map, acm) {
	TMenu.superclass.constructor.call(this, ctx, SceneManager);
	var Self = this;
	this.Level = 0;
	this.P2 = false;
	
	this.OnShow = function(){
		Map.Clear();
		Map.Prepare();
		switch (this.Level) {
			case 0:
				Map.AddStaticBoxFC(Map.widthD2, Map.heightD2 + 60, 10, 160, '#050505');
				Map.AddDynamicBoxA(Map.widthD2, Map.height - 35, 10, 58, 0, '#252525');
				
				var B = Map.AddDynamicBoxA(Map.widthD2, Map.heightD2 - 60, 10, 60, 0, '#252525');
				var Rope = Map.AddRope(Map.widthD2, 5, Map.widthD2 , Map.heightD2 - 90, 5, 0.5, '#550055');
				Map.Add_RJoint(Rope.End, B.Body);
				
				Map.AddStaticBoxFC(Map.width - 90, Map.height - 35, 10, 60, '#050505');
				Map.AddStaticBoxFC(Map.width - 15, Map.height - 35, 10, 60, '#050505');
				Map.AddDynamicBoxA(Map.width - 52, Map.height - 70, 88, 10, 0, '#252525');
				
				var D = Map.AddDynamicBallSprite(120, 75, 12, acm.Ss);
				Rope = Map.AddRope(120, 5, 120, 75- 12, 5, 0.5, '#550055');
				Map.Add_RJoint(Rope.End, D.Body);
				Map.AddDanger(D);
				
				D = Map.AddDynamicBallSprite(Map.width -120, 75, 12, acm.Ss);
				Rope = Map.AddRope(Map.width -120, 5, Map.width -120, 75- 12, 5, 0.5, '#550055');
				Map.Add_RJoint(Rope.End, D.Body);
				Map.AddDanger(D);
				
				
				Map.AddNazi(Map.widthD2 + 40, Map.height - 110, acm.W);	
				Map.AddNazi(Map.width - 52, Map.height - 40, acm.B);	
				
				Map.AddMe(50, Map.height - 25, acm.PTHero1);
				if (this.P2) 
				Map.AddMe(80, Map.height - 25, acm.PTHero2);
			break;
			case 1:
				Map.AddDynamicBoxFC(Map.widthD2 - 20, Map.height - 24, 8, 40, '#300000');
				Map.AddDynamicBoxFC(Map.widthD2 + 20, Map.height - 24, 8, 40, '#300000');
				Map.AddDynamicBoxFC(Map.widthD2, Map.height - 44, 60, 8, '#300000');
	
				var R1 = Map.AddRope(Map.widthD2 - 30, 5, Map.widthD2 - 20, Map.heightD2+2, 10, 0, '#555555');
				var R2 = Map.AddRope(Map.widthD2 + 30, 5, Map.widthD2 + 20, Map.heightD2+2, 10, 0, '#550055');
				var B1 = Map.AddDynamicBoxFC(Map.widthD2, Map.heightD2, 60, 8, '#222222');
				
				Map.Add_RJoint(R1.End, B1.Body);
				Map.Add_RJoint(R2.End, B1.Body);
				
				Map.AddNazi(Map.widthD2 - 10, Map.height - 70, acm.W);
				Map.AddNazi(Map.widthD2, Map.height - 25, acm.P);
				Map.AddNazi(Map.widthD2, Map.heightD2 - 15, acm.B);
				Map.AddNazi(Map.width- 50, Map.height - 50, acm.B);
				Map.AddNazi(Map.width - 100, Map.height - 40, acm.W);
				
				var Me = Map.AddMe(90, Map.height - 110, acm.PTHero1);
				var W = Map.AddDynamicBallSprite(Me.X, Me.Y-20, 7, acm.Ws);
				Map.Add_Force(W.Body, -0.5, 0);
				Map.AddRope2Obj(Me, W, 7, 0, '#550055');
				Map.AddWeapon(W);
				
				if (this.P2) {
				var Me2 = Map.AddMe(190, Map.height - 110, acm.PTHero2);
				W = Map.AddDynamicBallSprite(Me2.X, Me2.Y-20, 7, acm.Ws);
				Map.Add_Force(W.Body, 0.5, 0);
				Map.AddRope2Obj(Me2, W, 7, 0, '#550055');
				Map.AddWeapon(W);
				}
			break;
			case 2:
				var D = Map.AddDynamicBallSprite(120, 75, 12, acm.Ss);
				Rope = Map.AddRope(120, 5, 120, 75- 12, 5, 0.5, '#550055');
				Map.Add_RJoint(Rope.End, D.Body);
				Map.AddDanger(D);
				
				D = Map.AddDynamicBallSprite(Map.width -120, 75, 12, acm.Ss);
				Rope = Map.AddRope(Map.width -120, 5, Map.width -120, 75- 12, 5, 0.5, '#550055');
				Map.Add_RJoint(Rope.End, D.Body);
				Map.AddDanger(D);
				
				D = Map.AddDynamicBallSprite(Map.widthD2 -2, 75, 12, acm.Ss);
				Rope = Map.AddRope(Map.widthD2 -2, 5, Map.widthD2 -2, 75- 12, 5, 0.5, '#550055');
				Map.Add_RJoint(Rope.End, D.Body);
				Map.AddDanger(D);
				
			
				var Me = Map.AddMe(70, Map.height - 110, acm.PTHero1);	
				var W = Map.AddDynamicBallSprite(Me.X, Me.Y+20, 7, acm.Ws);
				Map.Add_Force(W.Body, -0.5, 0);
				Map.AddRope2Obj(Me, W, 7, 0, '#550055');
				Map.AddDanger(W);
				
				var Me2 = Map.AddMe(Map.widthD2 + 50, Map.height - 110, acm.PTHero2);
				W = Map.AddDynamicBallSprite(Me2.X, Me2.Y+20, 7, acm.Ws);
				Map.Add_Force(W.Body, 0.5, 0);
				Map.AddRope2Obj(Me2, W, 7, 0, '#550055');
				Map.AddDanger(W);
			break;
		}

		
	}
	
	function TLoseActor() {
		this.Draw = function() {
			ctx.drawImage(mImg, 402, 366, 94, 48, Map.widthD2-45, Map.heightD2-50, 94, 48);
		}
		this.Action = function() {
			SceneManager.ChangeScene(Self);
		}
	}
	var LoseActor = new TLoseActor();
	
	function TWinActor() {
		this.Draw = function() {
			if (Self.Level == 1)
				ctx.drawImage(mImg, 205, 390, 186, 24, Map.widthD2-93, Map.heightD2-24, 186, 24);
			else
				ctx.drawImage(mImg, 205, 360, 186, 24, Map.widthD2-93, Map.heightD2-24, 186, 24);
		}
		this.Action = function() {
			Self.Level++;
			SceneManager.ChangeScene(Self);
		}
	}
	var WinActor = new TWinActor();
	
	function Lose() {
		if ((Self.Level == 2) & (!Map.keyMe.Visible | !Map.keyMe2.Visible))
			SceneManager.MessageForm.Show(LoseActor);
		if (!Map.keyMe.Visible & !Map.keyMe2.Visible) 
			SceneManager.MessageForm.Show(LoseActor);
	}
	
	function Win() {
		if ((Self.Level < 2) & (Map.NaziLive())) 
			SceneManager.MessageForm.Show(WinActor);
	}
	this.Draw = function(){
		if (this.Level == 2)
			ctx.drawImage(mImg, 206, 421, 290, 88, Map.widthD2 - 145, Map.heightD2 - 48, 290, 88);
		Map.Draw();
	};
	
	this.Update = function(){
		Map.Update();
		//Map.keyMe.Demage(1);
		//Map.keyMe2.Demage(1);
		Win();
		Lose();
	};
	
	this.Mouse = function(X, Y) {
		Map.Click(X, Y);
	}


}
extend(TGame, TScene);