Introduction
My effort is to try and explain some basic concepts of programming based on really simple words and examples. This article has been posted also on codeproject
Background
The main idea behind a snake game (as in most such games) is to "fool" the user into thinking that a series of frames is in reality a moving object. Such a concept is fabricated in my implementation. The "motion" effect is based on a series of
Timer
events, each of which is "ticking" among specific intervals. The head of the snake is being drawn on a new position slightly misplaced to the direction of motion. The end of its tail is erased from our canvas, thus creating an illusion of motion.