Improve and optimization

This commit is contained in:
2024-07-18 22:59:03 +08:00
parent 1610584ce4
commit 1b3a9833eb
9 changed files with 110 additions and 53 deletions

View File

@@ -40,6 +40,8 @@ func (p *Tile) GetSize() land.Vector2D {
func (p *Tile) OnCollide(other land.CollidableObject) {
}
func (p *Tile) OnClick(mousePos land.Vector2D) {
log.Printf("user clicked tile: %s", mousePos.String())
func (p *Tile) OnEvent(event land.UserEventType, args ...any) {
if event == land.UserEventMouseDown {
log.Printf("user clicked tile: %s", args[0].(land.Vector2D).String())
}
}