lotsa fixes:

- fixed obstacle collision and death on obstacle spike
- moved player move into separate loop after other collision checks
  are done
- fixed level setup, generation and selection
- added test levels for obstacles
This commit is contained in:
2024-02-21 12:50:17 +01:00
parent 646b227b8e
commit f696660ccd
17 changed files with 74 additions and 15 deletions

View File

@@ -72,9 +72,9 @@ func (position *Position) String() string {
}
func (position *Position) Move(velocity *Velocity, speed *Speed) {
if velocity.Direction != 0 {
slog.Debug("moving", "velocity", velocity, "speed", speed)
}
// if velocity.Direction != 0 {
// slog.Debug("moving", "velocity", velocity, "speed", speed)
// }
position.Update(
position.X+(velocity.Data.X*speed.Value),
position.Y+(velocity.Data.Y*speed.Value),