Add new moods (happy, cry, poop) with animations and ChangeMood function in Zukitchi widget
This commit is contained in:
@@ -46,3 +46,18 @@ func draw(widget *text.Text) error {
|
||||
lastFrame = time.Now()
|
||||
return nil
|
||||
}
|
||||
|
||||
func ChangeMood(mood string) {
|
||||
pet.ChangeMood(mood)
|
||||
go func() {
|
||||
ticker := time.NewTicker(10 * time.Second)
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
pet.ChangeMood("idle")
|
||||
ticker.Stop()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user