Main Menu


Sponsored Links

  


  
  
Web Cartoon Maker: a Fun Way to Learn C++ Contents Previous Next

WCM C++ Program Structure

You know that usually animated cartoons and other kinds of movies consist of scenes. Animated cartoons you are going to make with Web Cartoon Maker also consist of scenes. The typical WCM C++ program looks like this:

void Scene1 ()

{

sentence1;

sentence2;

}


void Scene2 ()

{

sentence1;

sentence2;

}


Scene1 and Scene2 (and there may be more of them like Scene3, Scene4 and so on) are functions . Please do not pay attention on the parentheses and word void yet - their meaning will be explained later.

Note: For those of you who don’t want to wait for the full explanation – at a very simple level void and the parentheses just mean that Scene1 () is complete in itself, i.e. it doesn’t need any input from other parts of the program and does not supply any output from the function.

These functions contain instructions or sentences inside a pair of squiggly-braces ({ and }) specifying how to build a particular scene of your cartoon. Some simple cartoons may have only one scene and require only one Scene1 function. The order of appearance of these functions in your program does not matter. For example Scene2 can be placed before Scene1. There could also be any number of sentences inside these functions. Almost all the sentences must end with a semi-colon (;) .

Please keep in mind that words sentence1, sentence2 and ellipsis symbols are not part of WCM C++ but used for illustration only, because we do not know any real sentences yet.

Note: Also be aware that the exact definition of a “function” and the very similar “method” are not standard between, or sometimes even within, the various high level languages. Usually, these differences are not important but merely confusing, but beware that occasionally the differences can be significant. While the usage is consistent within this document, it may not be consistent with other documents, especially those addressing other high level languages.

So what is a minimal program we can write using WCM C++? Can we just use one Scene1 function with no sentences in it? Sure! The program below can really be compiled using WCM C++ and will produce a one second long black screen cartoon:

void Scene1 ()

{

}

But why one second long? Actually the length of your animated cartoon is calculated automatically depending on statements used. We did not use any statements and the length of our cartoon should be zero. But zero length cartoons may cause troubles for some third party software and WCM changes the cartoon length to one second when it is supposed to be zero.


Contents Previous Next
  
News

New Tales Animator Video by Alan Sturgess

Alan Sturgess shared an excellent video he made using Tales Animator! You can still download Tales Animator here. Unfortunately it is only available for Wi

...

Simple Online Character Designer

There is a prototype of simple online character designer available HERE. It is only a prototype, it does not contain many pieces yet but it can already generat

...

Book is updated

Now our book "Web Cartoon Maker: A Fun Way to Learn C++" is fully in synch with WCM 1.5! It is available for download and online reading HERE.

...

Web Cartoon Maker 1.5 is here!

Web Cartoon Maker 1.5 is finally here! You can download it HERE! Here is what was updated in version 1.5: Web Cartoon Maker Desktop Edition is now fully standal

...

read more news...


Poll