Skip to content

Commit

Permalink
Changed masses and added more asteroids.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzarg authored and Dzarg committed May 21, 2010
1 parent 35d3034 commit 738b802
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SpaceRun/SpaceRun.sln
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
# Visual C# Express 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceRun", "SpaceRun\SpaceRun.csproj", "{9F0BD864-EC0D-4CD5-A278-01D19A5545B2}"
EndProject
Global
Expand Down
2 changes: 1 addition & 1 deletion SpaceRun/SpaceRun/Game1.cs
Expand Up @@ -93,7 +93,7 @@ protected override void Update(GameTime gameTime)
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(new Color(0, 0.05f, 0.1f));
GraphicsDevice.Clear(new Color(0, 0, 0.02f));

GraphicsDevice.RenderState.DepthBufferEnable = true;
GraphicsDevice.RenderState.DepthBufferWriteEnable = true;
Expand Down
4 changes: 3 additions & 1 deletion SpaceRun/SpaceRun/Level.cs
Expand Up @@ -34,6 +34,7 @@ public void createAsteroid(Vector3 position)
Entity entity = new Asteroid();
entity.radius_m = 0.9f;
entity.position = position;
entity.mass_kg = 100000;
entity.scale = (float)(rand.NextDouble() * 3 + 0.2f);
entity.rotation = new Vector3((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble()) * 0.3f;
entity.velocity = new Vector3((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble()) * 0.1f;
Expand All @@ -47,6 +48,7 @@ public void createEnemyFighter(Vector3 position)
Entity entity = new AIShip();
entity.radius_m = 1.0f;
entity.position = position;
entity.mass_kg = 10000;
entity.model = ModelManager.get().getModel(ModelType.ENEMY_FIGHTER);
EntityManager.get().aiShips.Add(entity);
}
Expand All @@ -57,7 +59,7 @@ public void createPlanet(Vector3 position)
entity.radius_m = 1000.0f;
entity.scale = 1000.0f;
entity.position = position;
entity.mass_kg = 1e15f;
entity.mass_kg = 1e20f;
entity.rotation = new Vector3((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble()) * 0.01f;
entity.model = ModelManager.get().getModel(ModelType.PLANET);
EntityManager.get().planets.Add(entity);
Expand Down
2 changes: 1 addition & 1 deletion SpaceRun/SpaceRun/Level1.cs
Expand Up @@ -24,7 +24,7 @@ public override void populateLevel()
createWaypoint(new Vector3(1500.0f, 200.0f, 150.0f));

Random rand = new Random();
for (int i = 0; i < 300; i++)
for (int i = 0; i < 400; i++)
{
createAsteroid(new Vector3(rand.Next(50) - 25, rand.Next(50) - 25, rand.Next(500) - 500));
}
Expand Down

0 comments on commit 738b802

Please sign in to comment.