Animation in VB 2005 Console Application
Making animation program using VB 2005 console program is actually very simple application. The principle of actual animation is a process to print something the characters on the screen at some point later in the interval of a few seconds there is a process to delete or print a space so that the characters seem to move. In the VB 2005 console application, to print characters on the screen at point x, y then the syntax used nilaititikx and Console.CursorLeft = Console.CursorTop = y. This syntax is used to direct the cursor to be at the point x, y which have been determined. So that when a character wants to print the screen, always printed where the cursor position. To a point in the VB 2005 Console Application may only be occupied by a single letter (the unit used is the letter). Actual units used not only the letter there was another unit such as pixels, but which are discussed in this section is specific to the letter units.
Point x represents the column, while y represents the line on the screen. Many columns by default there are 80 letters and rows by 25 rows.
Statement is used for animations
- System.Threading.Thread.Sleep (var); this statement is similar to the delay statement on the program C + + or pascal. This statement is used to delay the program execution process for a few milliseconds. Or in other words the program will delay the execution process for a few milliseconds.
- Rnd; used to randomize the numbers. In this program, rnd statement is used to randomize the numbers which generated random numbers leads to the point x or y on the screen. And these numbers will be determined where these characters will be printed.
- Do Until the loop condition; Without repeating the statement animation programs do not go as we expect. Conditions of looping statement that we use for this program is Console.KeyAvailable = True. Which means that as long as there are no key presses from the keyboard, all statements that are inside the do until condition .... loop will be done repeatedly
Currently have 0 komentar: