Skip to content

Commit

Permalink
Blueprint (#16)
Browse files Browse the repository at this point in the history
* Adds more TODO items throughout the code

* Renames files
  • Loading branch information
MaxEdwards20 authored Mar 28, 2024
1 parent 333bee9 commit 20bc188
Show file tree
Hide file tree
Showing 19 changed files with 145 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore src/Entity\ Interpolation.sln
run: dotnet restore src/DuneSnake.sln
- name: Build
run: dotnet build src/Entity\ Interpolation.sln --no-restore
run: dotnet build src/DuneSnake.sln --no-restore
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ A game of Snake built using C# in the MonoGame framework, themed around everyone

## Items to Develop

- [ ] Animated Sprite for the spice - Satchel
- [ ] 3 different animated sprites for the spice - Satchel
- [ ] Collision detection. Know whether we hit spice or another sandworm
- [ ] Keyboard vs. Mouse input menu screen
- [ ] Camera movement
- [ ] Map generation
- [ ] Let player name themselves
- [ ] Mouse input support - Satchel
- [ ] Mouse input support - Satchel
- [ ] Food generation that refreshes as we play the game
- [ ] On collision, sandworm breaks apart and is available as food for other snakes
- [ ] Record players score, kills and highest position. Probably can be added to the `GameScores` object.
- [ ] Game over screen with score, kills, and highest position achieved
- [ ] Particle system for the death of a sandworm
- [ ] Sound effects on death of worm and when food is eaten - Satchel


## Done :)

- [x] MAX: Decide how to build the snake. Tons of entities? Or one entity with a list of positions?
- [x] MAX: Setup basic menuing

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ namespace Client.IO
/// Derived input device for the PC Keyboard
/// </summary>
// Added to support serialization



public class MenuKeyboardInput : IInputDevice
{
private KeyboardState m_statePrevious = Keyboard.GetState();
Expand Down
33 changes: 33 additions & 0 deletions src/Client/Menu/SelectControlsView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace Client.Menu;

// TODO
public class SelectControlsView : GameStateView
{
public override void loadContent(ContentManager contentManager)
{
throw new System.NotImplementedException();
}

public override MenuStateEnum processInput(GameTime gameTime)
{
throw new System.NotImplementedException();
}

public override void update(GameTime gameTime)
{
throw new System.NotImplementedException();
}

public override void RegisterCommands()
{
throw new System.NotImplementedException();
}

public override void render(GameTime gameTime)
{
throw new System.NotImplementedException();
}
}
11 changes: 11 additions & 0 deletions src/Client/Systems/Camera.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace Client.Systems;

public class Camera : Shared.Systems.System
{
public override void update(TimeSpan elapsedTime)
{
throw new NotImplementedException();
}
}
10 changes: 10 additions & 0 deletions src/Client/Systems/CollisionDetection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace Client.Systems;

public class CollisionDetection : Shared.Systems.System
{
public override void update(TimeSpan elapsedTime)
{
}
}
8 changes: 6 additions & 2 deletions src/Client/Systems/MouseInput.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using System;

namespace Client.Systems;

public class MouseInput
public class MouseInput : Shared.Systems.System
{

public override void update(TimeSpan elapsedTime)
{
}
}
6 changes: 6 additions & 0 deletions src/Client/Systems/ParticleEffects.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Client.Systems;

public class ParticleEffects
{

}
8 changes: 6 additions & 2 deletions src/Client/Systems/WormMovement.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using System;

namespace Client.Systems;

public class WormMovement
public class WormMovement : Shared.Systems.System
{

public override void update(TimeSpan elapsedTime)
{
}
}
File renamed without changes.
15 changes: 15 additions & 0 deletions src/Shared/Components/LifeTime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Shared.Components;

public class LifeTime: Component
{
public TimeSpan lifeTime { get; private set; }
public LifeTime(TimeSpan lifeTime)
{
this.lifeTime = lifeTime;
}

public void update(TimeSpan elapsedTime)
{
lifeTime -= elapsedTime;
}
}
6 changes: 6 additions & 0 deletions src/Shared/Components/Particle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Shared.Components;

public class Particle: Component
{

}
20 changes: 20 additions & 0 deletions src/Shared/Components/SpicePower.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Shared.Components;

public class SpicePower: Component
{
public int power { get; private set; }
public SpicePower(int power)
{
this.power = power;
}

public void addPower(int power)
{
this.power += power;
}

public void removePower(int power)
{
this.power -= power;
}
}
19 changes: 19 additions & 0 deletions src/Shared/Entities/Particle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.Xna.Framework;
using Shared.Components;
using Shared.Components.Appearance;

namespace Shared.Entities;

public class Particle
{
public Entity create( Vector2 position, Vector2 velocity, Vector2 size, TimeSpan lifeTime, float moveRate, float rotationRate )
{
Entity entity = new Entity();
entity.add(new Position(position));
entity.add(new Movement(moveRate, rotationRate));
entity.add(new Appearance("Textures/particle")); // TODO
entity.add(new Size(size));
entity.add(new LifeTime(lifeTime));
return entity;
}
}
28 changes: 0 additions & 28 deletions src/Shared/Entities/Player.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/Shared/Entities/Spice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public Entity create(Color color, Vector2 position, float size)
entity.add(new Position(position));
entity.add(new Size(new Vector2(size, size)));
entity.add(new Collision());
entity.add(new SpicePower(0));
return entity;
}
}
2 changes: 2 additions & 0 deletions src/Shared/Entities/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace Shared.Entities;


// NOTE: We will probably move this over to the wormMovement system where behavior lives
public class Utility
{
public static void thrust(Entity entity, TimeSpan elapsedTime)
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Entities/WormHead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Shared.Entities;

// This is the Player. We only move the head, all the other parts of the snake follow.
public class WormHead
{
public static Entity create(Color color, Vector2 position, float size, float moveRate, float rotateRate)
Expand All @@ -15,6 +16,7 @@ public static Entity create(Color color, Vector2 position, float size, float mov
entity.add(new Size(new Vector2(size, size)));
entity.add(new Movement(moveRate, rotateRate));
entity.add(new Collision());
entity.add(new SpicePower(0));

List<Input.Type> inputs = new List<Input.Type>();
inputs.Add(Input.Type.SnakeUp);
Expand Down

0 comments on commit 20bc188

Please sign in to comment.