Thursday, 10 November 2016

Score display in Pseudocode

Previous: Revisiting story line

To easily work out your game, it is good to align your game code through Pseudocode. This is artificial and informal language for developing algorithm. 

Our game:
Drop the box
collect the box

initialize boxcollected to zero
initialize totalboxes to zero

drop box
if collected 
  increase boxcollected by one
print boxcollected
end if
increase totalboxes by one
print totalboxes

The above forms bases of our code. This will be broken down into various functions in C#. It is self explanatory for a basic games. As we advance our story line, we will now be advancing our pseudo code. Every time you want to update your game, first update story line, then pseudo code before actual game coding. 

Next: Turning Pseudo code into C# code

No comments:

Post a Comment