Posted on 2020-05-14T06:14:20Z by Kevin Foong
So what is requestAnimationFrame?
requestAnimationFrame is a method that is part of the very large Web API's under the Window Interface. See this page for more information - https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame
This method provides a callback, typically to the function it is in, to create a recursive loop that can achieve up to 60 frames per second. I've created a very simple growing box animation in Vue to demonstrate.
Some key points,
.. more ..
Posted on 2019-05-08T11:59:33Z by Kevin Foong
This is the classic Snake game that I created in Processing. It is based off Dan Schiffman's great Processing tutorials here.
To play you have to eat the food (in green) but avoid the poison (in purple). The green food is worth 2 points. After a while it turns pink and is only worth 1 point. If you eat the poison 3 points is deducted. The controls is via a 3x3 grid mainly because it was originally designed to run on a mobile phone.
See Snake Game