|TCP on Winsock JAVA Edition XFlood applet Free game Tutorials Spiel: XFlood Kids game Paper Game J V M|
FULL Developers guide. Working out logical game on VB.
Dutch's VB Library Wallpapers www.see-search.com amidalla search engine
Free User Guide - How to make a new logic game on Visual BASIC - training guide for beginners users. Guidelines for programmers in VB 6.0 for new logical game programming. The document includes rules of the game, step-by-step programming process description in Word and EXE e-book formats, screenshots and 9 complete VB-projects (listings for each development step). Winsock VB Tutorial
Game algorithm description:
Game is conducted on a game field, which is optional size field (limited only to display size or convenience of programming). Since later on we’ll describe the process of developing the game graphic and PDA-versions, we have chosen 8x5 for the game table.
Free game description >> VB and TCP/IP >> Game >> Wallpapers changer >>
Free download: Free VB Guide in Word format [ mirror 1 ] [ mirror 2 ]
|Free download: Free VB Guide in ebook format [ mirror 1 ] [ mirror 2 ]|
|Free download: Free JAVA Programmers Guide [ mirror 1 ] [ mirror 2 ]|
|Free download: Free Delphi Programmers Guide [ mirror 1 ] [ mirror 2 ]|
|Free download: Game.Builder 1.00 on Visual Basic 6.0 [ mirror 1 ]|
|Free download: Free Game Download [ mirror 1 ] [ mirror 2 ]|
| Free download: Automatic Windows Desktop Styles Change from VB [ mirror 1 ]
|:: www.ebookdirectory.com :: Jogena's eBook and eZine Directories - Get Listed Today! ::|
All cells of the game field (table) are filled with symbols denoting the cell nominal values:
[-1,-5,-10,-15,-25] - deduct the indicated points from your account.
[1,5,10,15,25] - add the indicated points to your account.
[B] - deducts 200 points from your account.
[P] - adds 100 points to your account.
[T] - adds 500 points to your account.
[Z] - zeroes your account.
[END] - ends the game.
- your game account.
The player can perform only 2 actions on the game field:
1 – put “marker” on any cell of the game field bottom line only once at the game start (by clicking on the cell field).
2 – on putting the “marker”, the player can move it right or left along the game field bottom line by means of left and right arrows (keyboard button).
All cell nominal values to be “visited” by the player “marker” will be added to score. “Marker” is a cell highlighted in blue . To put a marker, click on any cell of the game field bottom line. “Marker” may be put only once. Then it can be moved many times. [Card game]
As soon as the player has put the marker, game starts. Game is conducted for time. A linear color indicator counts time intervals, at which all lines of game field are moved one line down. At that, a cell with a losing value may fall on the player “marker”. The player goal is to move the marker along winning cells, increase the score as possible, and watch the “marker” not to be “caught” by the cell from above with a losing nominal value (e.g., |Z|- score zeroing). [Free VB ebook]
Game is not as simple as it may seem. Its program has additional functions: acceleration and slowing down of game, changing winning cells frequency at the player large score. Game Oflameron may be realized in its static version, with no account of time. This version may have its benefits in the game process.
Game goal is to increase the score. Game (theoretically endless) may be stopped in the following situations: 1) the player “marker” falls to a cell with |End| nominal 2) the player score becomes negative 3) game has time limitation. Such flexibility of game algorithm allows to create a great number of its versions – with accumulation of “lives”, introduction of extra bonuses (cell nominal values), loading graphic design from the Internet, network versions for 2 players (static version) and paper version.
Brief description of a VB version game.
I.e., every cell is recorded in each cell Caption. Such method is not to be considered as an optimal one; further on other programming methods can be used. To see the results it is necessary to insert two procedures call: Private Sub Set_Nominal() and Private Sub Fdraw() in a program autostart (for a while):
Private Sub Form_Load()
A complete Visual Basic project of this game development stage is in the file vbg1.zip
Now it is necessary to create a procedure to analyze field(8, 6) array cell content, and depending on their values, to form a required symbol value (nominal) of a playing area cell and specify a required symbol and cell background colour.
Now, overwrite Fdraw() procedure in another one. Create another Label56 to temporarily store a generated cell nominal and its colour attributes (highlighted at the figure).
Source code Private Sub Color_Chars() see here.
Now add copying values and Label56 cell attributes in the playing area cell, and use several cycles to process the whole field(8, 6) array:
- copying example
Label7.Caption = Label56.Caption
Label7.BackColor = Label56.BackColor
Label7.ForeColor = Label56.ForeColor
As a result there appears a nominal copying Sub Field_Fill() procedure from a responsible cell Label56, while a procedure Color_Chars() is changed in the following way - see code.
Such variant of filling a playing area with START values (at the start of the game) cannot be considered as an optimal one. However it is very demonstrable for algorithm understanding.
Form_Load() procedure looks like following:
Private Sub Form_Load()
To see how it works add another Form_Click() procedure (for a while, for the program debugging):
Private Sub Form_Click()
Set_Nominal ‘Fill array field(i,j)
Fdraw ‘Draw field(i,j) – for debug
Field_Fill ‘Print real nominals
- it is absolutely identical to Form_Load() procedure
To draw real cell nominals and colour attributes. Now, clicking the mouse to Form1 field (only forms) you can see if the cell nominals values and their colour attributes are changed correctly.
A complete Visual Basic project of this game development stage is in the file vbg2.zip
Form_Click() procedure can be deleted.
Now develop Num_Move() procedure to overwrite playing area cells’ values and colour attributes in a row-wise top-down way and to fill a playing area top row with new values (i.e., new cell values are input in the game from the top row). The procedure contains copying operators. You can develop a more optimal copying algorithm.
Private Sub Num_Move()
For j = 0 To 4
For i = 0 To 7
field(i, j) = field(i, j + 1)
To see how top-down copying values and cell attributes works, create a temporary click handling procedure at Frame1:
Private Sub Frame1_Click()
A complete Visual Basic project of this game development stage is in the file vbg3.zip
Now it necessary to add Private Sub Up_Str_App() code to fill in the playing area top row with new values - see code.
Attach the Frame1.Click procedure call
A complete Visual Basic project of this game development stage is in the file vbg4.zip
Click the mouse to the Frame1 field and see how it works!
Now it is necessary to write a handling code for player’s placing a game marker in any bottom row cell of the playing area.
The procedure to save colour attributes of all bottom row cells before placing the marker:
Save_Color() procedure is used to restore cell colour when moving the marker horizontally (along the bottom row of the playing area).
Create a markersave variable to memorize an array ELEMENT NUMBER savecolor(j), the variable corresponding to the marker cell (i.e. the cell, in which the marker has been placed).
The possibility of placing a marker on one cell only can be checked. Now it is necessary to provide a marker being saved (in terms of cell turning blue) when shifting cells top – down.
The procedure of marker colour restoring after playing area cells shifting top-down:
Private Sub Marker_Reset()
If markersave = 0 Then Label7.BackColor = &HFF0000
If markersave = 1 Then Label8.BackColor = &HFF0000
If markersave = 2 Then Label9.BackColor = &HFF0000
If markersave = 3 Then Label10.BackColor = &HFF0000
If markersave = 4 Then Label11.BackColor = &HFF0000
If markersave = 5 Then Label12.BackColor = &HFF0000
If markersave = 6 Then Label13.BackColor = &HFF0000
If markersave = 7 Then Label14.BackColor = &HFF0000
Now activate Marker_Reset() procedure to operate in a top-down shift procedure. In the bottom of Frame1_Click() procedure insert the following code (marked as underline):
Private Sub Frame1_Click()
Num_Move 'Shift the values of all rows one row down
Up_Str_App 'Fill in the top row with new nomimals
Marker_Reset 'Marker redraw
A complete Visual Basic project of this game development stage is in the file vbg5.zip
Write a score count procedure when placing a marker in the beginning of the game - see code.
Now attach a score count procedure in each of click procedures for bottom row cells:
Private Sub Label7_Click()
If firstset = 0 Then Save_Color 'Save bgcolor
If firstset = 0 Then Label7.BackColor = &HFF0000 'Set new bgcolor (blue)
If firstset = 0 Then firstset = 1 'No use again
markersave = 0
Set_Marker_Count ‘Rewrite counter
For other bottom row cells the procedure is exactly the same.
Now write a score counting procedure at cells’ shifting top-down. Procedure looks like extremely simple:
Private Sub Dn_Count()
n = 0 ‘Temporarily to resolve work of procedure Set_Marker_Count
Set_Marker_Count ‘Procedure of calculation of glasses after installation of a marker
To demonstrate the procedure operation, insert the procedure call in a top-down cell row shifting procedure Frame1_Click():
Private Sub Frame1_Click()
Num_Move 'To move values of all cells from above - downwards
Up_Str_App 'To fill in the top line of a game field new values
Marker_Reset 'Rewrite marker
Dn_Count 'To count up glasses at moving lines from above - downwards
A complete Visual Basic project of this game development stage is in the file vbg6.zip
Create a procedure of linear colour indicator operation. Add Timer1 to the form and enable it at once. see code.
You can see how the indicator works.
Now you should disable the timer and enable it after the market has been placed in a playing area bottom row. Insert timer enabling in a marker placing procedure in a playing area bottom row (to be more exact – in a score counting procedure after marker placing Set_Marker_Count(), since the procedure is common for all cells of a lower level). At the end of the procedure Set_Marker_Count() there is a line:
Timer1.Enabled = True 'The timer is ON since the marker is put
A complete Visual Basic project of this game development stage is in the file vbg7.zip
When a linear colour indicator disappears completely, it is necessary to shift down all rows with playing area cells (Frame1_Click() procedure) to the marker, count scores and fill in a playing area top row with new nominal values.
Timer1 operation procedure looks like the following way:
Private Sub Timer1_Timer()
IndLent = IndLent + 1
If IndLent = 9 Then
IndLent = 0
Timer1.Interval = 500
Frame1_Click 'To move levels
Print_Ind 'Draw indicator
Keyboard Now it is necessary to write handling of pressing down the key and marker’s moving to the [right] / [left] along the bottom row of playing area cells.
Place another timer (Timer2) at Form1. Set a time interval Timer2 = 50 and place a key status test code in a printer operation procedure. Declare procedure operation functions:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
And a handling code as such - see code.
Inscriptions in Left and Right form header are presented only for debugging purposes. Markersave variable shows a unique playing area bottom row cell that contains a marker. Write a procedure of marker moving to the left / right along the bottom row - see code.
Now it is necessary to create only one procedure – a procedure of shifting the numbering of current gaming level |Level|:
Private Sub Level_Count()
Label6.Caption = Label6.Caption + 1
Label5.Caption = Label6.Caption + 1
Label4.Caption = Label5.Caption + 1
Label3.Caption = Label4.Caption + 1
Label2.Caption = Label3.Caption + 1
Attach a shifting procedure to the operations, for example:
Private Sub Dn_Count()
n = 0
Level_Count 'Move Level
A complete Visual Basic project of this game development stage is in the file vbg8.zip
Now, this is a demonstrative moment: all software-realization procedures of the game Oflameron are ready. In other words, you have created a completely operable logical gaming program in Visual Basic. It is still early to introduce it as a commercial product as it still contains many faults. For example, when clicking the Frame object the game starts without placing the marker. Removing such faults and configuring the game as a commercial product are dealt in the 2nd & 3d parts of the guidelines.
One of the 2nd parts variants (with system of bonuses , variants of complication of game , connect to Internet) - in file vbg15.zip
Copyright (c) by Valery V Shmeleff www.oflameron.ru
Free VB Tutorials: full list of free tutorials for beginners users on www.oflameron.com
Write your comment: