Browse Source

Fix increasing amounts of creeps bug

main v1.0.1
Trevor Slocum 6 months ago
parent
commit
475effa11e
  1. 4
      system/render.go
  2. 4
      system/renderhud.go
  3. 2
      world/world.go

4
system/render.go

@ -92,10 +92,6 @@ func (s *RenderSystem) renderSprite(x float64, y float64, offsetx float64, offse
//s.op.GeoM.Translate(float64(s.ScreenW/2.0), float64(s.ScreenH/2.0))
// Fade in.
if world.World.Tick < 72 {
colorScale = float64(world.World.Tick) / 72
}
s.op.ColorM.Scale(colorScale, colorScale, colorScale, alpha)
target.DrawImage(sprite, s.op)

4
system/renderhud.go

@ -51,10 +51,6 @@ func (s *RenderHUDSystem) Update(_ gohan.Entity) error {
}
func (s *RenderHUDSystem) Draw(_ gohan.Entity, screen *ebiten.Image) error {
if !world.World.GameStarted {
return nil
}
if world.World.ScoreUpdated {
s.drawScore()
world.World.ScoreUpdated = false

2
world/world.go

@ -115,6 +115,8 @@ func Reset() {
World.NeedKills = NeededKills()
World.KillInfoUpdated = true
World.Tick = 0
seed := World.ForceSeed
if seed == 0 {
seed = time.Now().UnixNano()

Loading…
Cancel
Save