How to write board games with ebiten properly? #1782
-
I'm making a board game(reversi) with ebiten, which let humans against computer.
I chose to create a new goroutine rather than put it into My solution above ( Is there any other better way to dealing with it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The concurrent switching might not work well on Wasm. What about calling In general, you should avoid a busy loop that never sleeps. I'd insert sleeping |
Beta Was this translation helpful? Give feedback.
The concurrent switching might not work well on Wasm. What about calling
runtime.Gosched()
?In general, you should avoid a busy loop that never sleeps. I'd insert sleeping
time.Sleep(time.Millisecond)
, or, adjust the amount of the calculation by channels.