Saturday, September 29, 2012

DSDN 142: My Pseudo-Code

For coding we have to create a sort of pseudo-code. This is to help us understnad exactly what we want to achieve. The pseudo code is a sort of recipe for planning out our Processing code, that's written in plain English.

Main_Reaction: Plant Growth
A plant sprouts from the hill surface.
It grows slowly as its first sun dies.

If Sun_Creation is called,
   The plant grows towards the sun that has been created.
   If the plant is close to a sun for a long enough time,
      It grows leaves and a flower.
   Else it splits and grows in two directions.

   If the plant is intersected by the edge of the suns heat,
      It turns to ash and fades away and a new plant grows from its ashes.

Else the plant waits for a sun to be created.

Main_Interaction: Sun_Creation
Repeat() {

   The user moves the mouse to the desired location for the sun.
   The user clicks and holds the mouse at said location.
   A sun slowly grows from users mouse.
   The longer the user holds the mouse, the larger the sun grows.

   The user releases the mouse after an arbitrary amount of time.
   The sun now begins to decay and dims and gets smaller.
   The sun disappears.


No comments:

Post a Comment