Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.6 KB

README.md

File metadata and controls

25 lines (18 loc) · 1.6 KB

Description

A version of chess where you launch your pieces at the enemy and try to knock their king off the edge of the board.

To play it, clone the repo and open index.html. It can also be played on my website.

Credit

  • Ben Adcock for contributing bug fixes & features.

Debugging Over Wi-Fi

Quoting Ben Adcock:

If you have the Go SDK installed you can run "go run webserver.go" and it'll spin up a webserver on port :3000 which you can then use for debugging with real devices over Wi-Fi.

References

Game loop:

Then we start the game loop. In this we update the logic of the game as many times as it's supposed to be updated the current loop. Each time the timer ticks, the logic is supposed to be updated, so we simply update as many times as there has been ticks since the last loop. We also keep track of how long the logic step is taking: if it starts taking too long, we break out of the logic loop and draw a frame. If the drawing takes more than one tick, it updates for every tick passed before drawing again. If the drawing takes less than a full tick, we rest until the full tick has passed, allowing for an efficient utilization of the CPU.