CHALLENGES


  1. Spice up the Click Race game by redecorating it a bit. For example, play around with the background and foreground colors of the form and other controls to create a color scheme that is more to your personal liking.

  2. If you place the cursor over one of the edges of the Click Race game's window, you can resize it, resulting in a less-than-attractive result. Prevent this behavior by locking the dimensions of the window into place. (Hint: Click on the form and set the FormBorder-style property equal to one of the "Fixed" border styles in the drop-down list that will appear.)

  3. As it is currently written, the Timer1 control keeps on ticking after the player's turn ends. This is OK because the Timer1 control Is restarted as soon as the player clicks on Start again. However, allowing the Timer1 to keep running does waste CPU processing cycles. It would be more efficient if you had the Timer1 control disable itself at the end of the player's turn. (Hint: Add Timer1.Enabled = False as the last statement in the Timer1_Tick procedure.)

  4. Make the game a little slicker by adding a Textbox that displays the amount of time that the player has left as the game progresses. (Hint: Add a Textbox to the form. Make sure it is named TextBox2 and then modify the code associated with the Timer1 control as shown below in bold.)

     Private Sub Timer1_Tick(ByVal sender As  System.Object, _   ByVal e As System.EventArgs) Handles Timer1.Tick         intTimerCount =  intTimerCount + 1 If intTimerCount = 30 Then              Button1.Enabled = False              Button2.Enabled = False              Timer1.Enabled = False          End If          TextBox2.Text = intTimerCount End Sub 




Microsoft Visual Basic 2005 Express Edition Programming for the Absolute Beginner
Microsoft Visual Basic 2005 Express Edition Programming for the Absolute Beginner
ISBN: 1592008143
EAN: 2147483647
Year: 2006
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net