Game Development Reference
In-Depth Information
are assumed to never have used the system before, but if they suc-
ceed, the tutorials are quickly taken away. Let's take a look at some
pseudocode to write a scaffolded version of the hearthstone tutorial
modification illustrated previously. Admittedly, using the hearthstone
isn't the most complicated process in the world, but it will serve to
demonstrate a point and illustrate some pseudocode that I use to com-
municate with programmers on my projects.
//Pseudocode for Hearthstone (Scaffolded)
var tipIndex[60];
populateArray(tipIndex);
//assume array is full of relevant tips
//let tipIndex 31 = Hearthstone
function ShowHearthStoneTip(timeArg)
{
showTip(31);
timeOnScreen = timeArg;
shownTip[31] = true;
}
if (shownTip(31) == true && HearthstoneInterrupted ==
true)
{
tipIndex[31].failure ++;
}
//set a low failure threshold
if (tipIndex[31].failure >= 3)
{
shownTip[31] = false;
}
function OnHearthStoneCast()
{
if (shownTip[31] == false)
{
ShowHearthStoneTip(tipIndex[31].failure || 3.0);
}
}
Unlike the previous example, this piece of instruction is front-
loaded. That is to say, it shows the tip right off the bat, assuming that
Search WWH ::




Custom Search