mirror of
https://github.com/Kugelschieber/go-game.git
synced 2026-01-18 06:40:28 +00:00
Fixed log output in culling, updated demo.
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
package goga
|
||||
|
||||
import (
|
||||
"log"
|
||||
)
|
||||
|
||||
const (
|
||||
culling_2d_name = "culling2d"
|
||||
)
|
||||
@@ -90,10 +86,8 @@ func (c *Culling2D) Update(delta float64) {
|
||||
c.cullables[i].Pos.Y > c.viewport.W ||
|
||||
c.cullables[i].Pos.Y+c.cullables[i].Size.Y < c.viewport.Y {
|
||||
c.cullables[i].Visible = false
|
||||
log.Print("h")
|
||||
} else {
|
||||
c.cullables[i].Visible = true
|
||||
log.Print("s")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,21 @@ func (g *Game) Setup() {
|
||||
}
|
||||
|
||||
sprite := goga.NewSprite(tex)
|
||||
goga.AddActor(sprite)
|
||||
renderer, ok := goga.GetSystemByName("spriteRenderer").(*goga.SpriteRenderer)
|
||||
|
||||
if !ok {
|
||||
panic("Could not find renderer")
|
||||
}
|
||||
|
||||
renderer.Add(sprite.Actor, sprite.Pos2D, sprite.Tex)
|
||||
|
||||
culling, ok := goga.GetSystemByName("culling2d").(*goga.Culling2D)
|
||||
|
||||
if !ok {
|
||||
panic("Could not find culling")
|
||||
}
|
||||
|
||||
culling.Add(sprite.Actor, sprite.Pos2D)
|
||||
}
|
||||
|
||||
func (g *Game) Update(delta float64) {}
|
||||
|
||||
Reference in New Issue
Block a user