Presentation is loading. Please wait.

Presentation is loading. Please wait.

Main Program Add Needed Libraries i =0 i <5 Draw boundary lines i++

Similar presentations


Presentation on theme: "Main Program Add Needed Libraries i =0 i <5 Draw boundary lines i++"— Presentation transcript:

1 Main Program Add Needed Libraries i =0 i <5 Draw boundary lines i++
Create Classes to hold functions Generate a Food Run input function While Proteus on is “true” Update Snake Run Menu function Clear the previous snake While running game is “true” Draw new snake Check Death conditions Draw main snake

2 Menu Function 1st Spot? Proteus equals “False” 5th Spot?
Print Menu 1st Spot? Proteus equals “False” 5th Spot? While Menu is “true” Proteus equals “False” Run Rules function Menu equals “true: 2nd Spot? Run Leaderboard 3rd Spot? Middle Click? Run Credits 4th Spot? Reprint menu using input

3 Rules Function Print the rules to screen. Sleep for a couple seconds
Clear screen

4 Leaderboard Function Print the leaderboard to screen
Save current food score as Z Sort all values in order of score Print the leaderboard to screen Sleep for a couple seconds

5 Credits Function Print the credits to screen.
Sleep for a couple seconds Clear screen

6 Draw Borders Function Print these shapes to the screen.
Generate a rectangle on each wall Print these shapes to the screen.

7 User Input Function Sleep until input Add Upward Velocity
Middle(Up) button? Add Right Velocity Add Downward velocity Right button? Add Left Velocity Left button?

8 Update Snake Function i = numDots -1 i >0 i-- Set the location of segment equal to the one prior to it in the body.

9 Draw Snake Function Draw a snake section at the location of dots[i]
i <numDots i-++ Draw a snake section at the location of dots[i]

10 Check Death Conditions Function
Bring in coordinates for Snake Killing Snake, ending game Snake in contact with wall? Killing Snake, ending game Snake in contact with self?


Download ppt "Main Program Add Needed Libraries i =0 i <5 Draw boundary lines i++"

Similar presentations


Ads by Google