Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Commit

Permalink
Se activo el sonido y unas ultimas pulidas
Browse files Browse the repository at this point in the history
  • Loading branch information
ammasotta committed May 30, 2018
1 parent 6a3a1d1 commit d68011a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 30 deletions.
47 changes: 25 additions & 22 deletions TGC.Group/Model/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public GameModel(string mediaDir, string shadersDir) : base(mediaDir, shadersDir
private Drawer2D drawer;
private Hud hud;

public Torre porongadeprueba;

/// <summary>
/// Representa el scene donde actualmente esta el jugador.
/// </summary>
Expand Down Expand Up @@ -148,10 +148,6 @@ public override void Init()

}

var ub = navePrincipal.GetPosition() + new TGCVector3(0, 0, -1000f);
porongadeprueba = new Torre(MediaDir);
porongadeprueba.Relocate(new TGCVector4(ub.X, ub.Y, ub.Z, 0));


//enemigos[0].Relocate(new TGCVector3(0,0,-400f));

Expand Down Expand Up @@ -181,25 +177,26 @@ public override void Init()
};
sonidoMenu = new TgcMp3Player
{
FileName = MediaDir + "Music\\musica_menu.mp3"
FileName = MediaDir + "Sound\\musica_menu.mp3"
};

sol = TGCBox.fromSize(new TGCVector3(0,-500,0), new TGCVector3(5, 5, 5), Color.Yellow);
sol.AutoTransform = true;
/*if(menu.sonidoAmbiente())
menu = new Menu(MediaDir, Input);
if (menu.playSonidoAmbiente)
{
sonidoAmbiente.play(true);
}

if (menu.sonidoMenu)
{
sonidoMenu.play(true);
}*/
//if (menu.playSonidoMenu)
//{
// sonidoMenu.play(true);
//}

//Sonido laser
//sonidoLaser = new TgcMp3Player();
//sonidoLaser.FileName = MediaDir + "Music\\laserSound.mp3";
menu = new Menu(MediaDir,Input);

drawer = new Drawer2D();
hud = new Hud(MediaDir, Input);
}
Expand Down Expand Up @@ -257,19 +254,25 @@ public override void Update()
{
if (movimientoZ > movimientoMaximoZ)
movimientoZ -= factorMovimientoZ * 3;

movimientoNave.Z = movimientoZ;
navePrincipal.GastarFuel(1.5f, hud);
}


if ((Input.keyDown(Key.Up) || Input.keyDown(Key.W)) && !Input.keyDown(Key.LeftShift))
}
if (movimientoZ < movimientoBaseZ)
{
if (movimientoZ < movimientoBaseZ)
movimientoZ += factorMovimientoZ;
movimientoZ += factorMovimientoZ;
}

movimientoNave.Z = movimientoZ;
}



//if ((Input.keyDown(Key.Up) || Input.keyDown(Key.W)) && !Input.keyDown(Key.LeftShift))
//{
// if (movimientoZ < movimientoBaseZ)
// movimientoZ += factorMovimientoZ;

// movimientoNave.Z = movimientoZ;
//}
//Movernos adelante y atras, sobre el eje Z.

//if (movimientoZ < movimientoBaseZ)
Expand Down Expand Up @@ -339,7 +342,7 @@ public override void Update()
currentScene = escenarios[nextSceneIndex];

if (enemigos.FindAll(enemigo => enemigo.EstaViva()&&enemigo.EnemigoEstaAdelante()).Count < 3)
enemigos.FindAll(enemigo => !enemigo.EstaViva()||!enemigo.EnemigoEstaAdelante())[0].Relocate(new TGCVector3(200f, 200f, -1000f));
enemigos.FindAll(enemigo => !enemigo.EstaViva()||!enemigo.EnemigoEstaAdelante())[0].Relocate(new TGCVector3(100f, 100f, -3000f));
}

// No permitir que se salga de los limites, el salto que hace para volver es medio brusco, se podria atenuar.
Expand Down Expand Up @@ -473,7 +476,7 @@ public override void Render()
es.Render();
});

porongadeprueba.Render();

this.navePrincipal.Render();

enemigos.FindAll(enemigo => enemigo.EstaViva()).ForEach(enemigo =>
Expand Down
7 changes: 2 additions & 5 deletions TGC.Group/NaveEnemiga.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ private void ObtenerMovimiento(ref TGCVector3 movimiento)

movimiento.X = ObtenerDireccion(MovementVector.X, naveAPerseguir.GetPosition().X);
movimiento.Y = ObtenerDireccion(MovementVector.Y, naveAPerseguir.GetPosition().Y);
if (this.EstaLejos())
movimiento.Z = this.ObtenerDireccion(this.MovementVector.Z, naveAPerseguir.GetPosition().Z);
else
movimiento.Z = -2f;
movimiento.Z = ObtenerDireccion(MovementVector.Z, naveAPerseguir.GetPosition().Z);
}

private bool EstaCerca()
Expand All @@ -90,7 +87,7 @@ private bool EstaCerca()
public void Perseguir(float elapsedTime)
{
var movimiento = TGCVector3.Empty;
if (!this.EstaAlineado()/*||EstaLejos()*/||EstaCerca())
if (!this.EstaAlineado()||EstaLejos())
{
this.ObtenerMovimiento(ref movimiento);
this.Move(movimiento * elapsedTime);
Expand Down
16 changes: 14 additions & 2 deletions TGC.Group/TGC.Group.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -56,6 +58,9 @@
<ApplicationIcon>Death-Star-icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BulletSharp, Version=0.10.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\BulletSharp.0.10\lib\net40-client\BulletSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.dll</HintPath>
Expand All @@ -77,8 +82,8 @@
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="TGC.Core">
<HintPath>..\..\Documents\TGC\tgc-viewer-2.3.1\TGC.Core\bin\Debug\TGC.Core.dll</HintPath>
<Reference Include="TGC.Core, Version=2.3.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TGC.Core.2.3.3\lib\net471\TGC.Core.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -3713,6 +3718,13 @@
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<Import Project="..\packages\BulletSharp.0.10\build\net40-client\BulletSharp.targets" Condition="Exists('..\packages\BulletSharp.0.10\build\net40-client\BulletSharp.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\BulletSharp.0.10\build\net40-client\BulletSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\BulletSharp.0.10\build\net40-client\BulletSharp.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
3 changes: 2 additions & 1 deletion TGC.Group/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="TGC.Core" version="2.3.1" targetFramework="net471" />
<package id="BulletSharp" version="0.10" targetFramework="net471" />
<package id="TGC.Core" version="2.3.3" targetFramework="net471" />
</packages>

0 comments on commit d68011a

Please sign in to comment.