
05-17-2011, 12:38 PM
|
 |
Newcomer
|
|
Join Date: Apr 2009
Location: Netherlands
Posts: 17
|
|
Computer as oponent
|
All,
Whilst developing a game (for the PocketPC, but it also works on a PC) I have created a function which should act as the move the computer, as oponent player, should make. The game-grid is build as a variable square of 'buttons' and the computer does calculate the correct 'button' to select. My problem now is how to implement this into the code correctly. What location and/or what construction is to be used? The human-player actions are caught by an "Btn_Click(ByVal sender As Object, ByVal e As System.EventArgs)" event, but how can I implement such alike for the compuer function?  The computer might be the first player and the "Btn_Click" event is therefore not the correct starting point to call for the coputer function, I assume....
For better reference I added the VB2005 source code to this mail; I hope this helps. I hope I made enough comments in the code to be clear. Lots of lines are to be taken out eventually and the code optimized, but that is not the point now....
Any comments or thoughts and help is welcome, many thanks in advance!
Adri
|
|