---
# System prepended metadata

title: Sprint 2 Presentation

---

# Sprint 2 Presentation




## Collision Detection:
This week we essentially completed collision detection and added functionailty for directional collision detection. We can now determine from the point of view of both colliding objects where the collision takes place allowing for specific responses depending on collision direction.
```java=
  public void collide(GameObject self, GameObject other) {
  
    String selfDirection = detectCollisionDirection(self, other);
    String otherDirection = detectCollisionDirection(other, self);
    
    CollisionInfo info = new CollisionInfo(self, other, selfDirection);
    myActionManager.handleAction(self, other, info);
    
    info = new CollisionInfo(other, self, otherDirection);
    myActionManager.handleAction(other, self, info);
  }
```


## Game Creation:
This week we finalized the creation of levels using configuration files. Given an objects file with presets as shown below, a game can be created and played through that looks as such.

```json=
[
  {
    "name": "goomba",
    "height": 50,
    "width": 50,
    "imageID": "goomba",
    "components" : [
      {
        "type" : "PlayerComponent"
      }
    ]
  },
  {
    "name" : "qblock",
    "height" : "50",
    "width" : "50",
    "imageID" : "qblock"
  },
  {
    "name" : "brick",
    "height" : "50",
    "width" : "50",
    "imageID" : "brick"
  },
  {
    "name": "mario",
    "height": 50,
    "width": 50,
    "imageID": "mario"
  },
  {
    "name" : "block",
    "height" : 50,
    "width" : 50,
    "imageID" : "block"
  }
]
```

![](https://i.imgur.com/aKdJf6Z.png)

### Selection updates

On the interface there are a few simple updates such as:

- Caching games that the user has previously added
- Deleting games that you've added
- running games right from the game list with a context menu

The game can now load in and be displayed when run.

### Systems
#### NPC Systems:
- MovementSequence Component

#### Attack Systems:
- Hate Component
- Attack Frequency
- Tracing Component (haven't finished yet)

#### Equipment System
- Payload
- Mulitiplier Component

#### Player System
- Air friction for vertical speed

### Notable Updates

- Use reflection to get all types of components
- Systems are created using configuration files
- Collision detection working
- View can update based on movements
- 