This commit is contained in:
anton.gurov 2019-11-08 14:48:47 +03:00
parent 482ab67156
commit 7411f05685

View File

@ -126,25 +126,21 @@ import blt "some.repo.ru/user/bearlibterminal"
var State main.GameState var State main.GameState
//функция скажем поднятия описание предмета... //функция скажем поднятия особенного предмета...
func (item *Item) Pickup() { func (item *SpecialItem) Pickup() {
.... ....
doSuperEffect(State) //выполняем строго в main thread
}
//and there we go like this:
func doSuperEffect(State main.GameState) {
...
State.Do(func() { State.Do(func() {
renderSuperEffect() renderSuperEffect()
// ...do stuff in main thread
}) })
...
} }
... ...
//тут собственно отрисовка эффекта
func renderSuperEffect() { func renderSuperEffect() {
...
blt.Layer(0) blt.Layer(0)
blt.Print("WAAAGH") blt.Print(x,y, "WAAAGH")
... ...
} }
``` ```