Case%20Study%20 - PowerPoint PPT Presentation

About This Presentation
Title:

Case%20Study%20

Description:

Case Study Snake Game Lesson 14 For Today: Run the Snake Game Draw with individual pixels (pages 272 275) Open Visual Basic Open Snake Game from Lesson 1. – PowerPoint PPT presentation

Number of Views:192
Avg rating:3.0/5.0
Slides: 12
Provided by: Scho2212
Category:
Tags: 20study | case | study

less

Transcript and Presenter's Notes

Title: Case%20Study%20


1
Case Study Snake Game
  • Lesson 14
  • For Today
  • Run the Snake Game
  • Draw with individual pixels (pages 272 275)

2
Open Visual Basic
  • Open Snake Game from Lesson 1.
  • Play the game!

3
Drawing with Pixels and Using AutoRedraw
  • PSet to Draw
  • Is a easy-to-use feature that allows you to
    change the color of individual pixels on a form.
  • To use you only need to identify the pixel
    using X,Y coordinates and specify the color.
  • Example
  • PSet (120,200), vbRed
  • Dont forget to set the Scale Mode property to
    pixel measurement.

4
Let create a line!
  • Create a new project!
  • Set the Name property of the form to frmMain.
  • Set the caption to Draw Line.
  • Add a command button.
  • Set the name to cmdLine
  • Set the caption to Draw Line

5
You should have the following form
6
  • Double click the Draw Line button.
  • Add the following code
  • ScaleMode vbPixels
  • Dim Counter As Integer
  • For Counter 40 to 200
  • Pset (Counter, 50), vbRed
  • Next Counter

7
  • Run your program!
  • Fix your bugs.
  • What happens?

8
Another Program!
  • Open the Draw Line program from
  • Lesson 14.
  • Change the caption of the command button to Draw
    Lines.
  • Change the caption of the form to Draw Lines.

9
  • Double click the command button and modify your
    coding to match the following
  • ScaleMode vbPixels
  • Dim Counter As Integer
  • For Counter 40 To 200
  • PSet (Counter, 50), vbRed
  • PSet (Counter, 75), vbBlack
  • PSet (Counter, 100), vbBlue
  • PSet (Counter, 125), vbGreen
  • Next Counter

10
  • Close the code window and run your program.
  • What happens?

11
Homework!
  • Test on Friday!
  • Lesson 12, 13, and 14.
  • Read Lesson 14.
  • Study for test!
Write a Comment
User Comments (0)
About PowerShow.com