Main Menu


Sponsored Links

  


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

Introduction

You probably already guessed that Image , Text and characters are classes. You can even find their declarations at http://www.webcartoonmaker.com/?art=help/includes :

You will not find the actual code of these classes but only declarations of all members. This is because these classes are internal WCM C++ classes. But good news is that you can inherit them! For example we can find a declaration of character Boy and change his walking style!

The class hierarchy starts with the ICharacter class and incudes other classes class derived from ICharacter like ISpeakableCharacter , IHumanCharacter or IHumanCharacterSideView . You probably noted a first capital letter "I" in the names of these classes. We added these letters to indicate that these are "interface" (or abstract) classes. These classes are incomplete. They have some useful methods to register and work with characters; some of them have common parts declared but none of them have actual pictures assigned with parts. To make these classes useful you need to derive a new class, such as Boy from them.

Looking into character Boy declaration you will find out that it is derived from IHumanCharacterSideView :

IHumanCharacterSideView is, in turn, derived from the class IHumanCharacter :

IHumanCharacterSideView has a method GoesTo . (Please do not pay too much attention to word virtual, it just indicates that this method is being defined in an abstract class. , a fact that is not particularly important for creating WCM cartoons.

Note: If you are interested in general C++ programming, you should study this concept as explained in a general C++ reference book or web site.

The method GoesTo takes 3 mandatory parameters and one optional parameter with default value of 1 . dX and dY are the target coordinates. dDuration is the duration of walking in seconds. dStepDuration is the duration of one step in seconds. This method will be changed in the next section.

The full class hierarchy for Boy is:

IObject

|

ICharacter

|

ISpeakableCharacter

|

IHumanCharacter

|

IHumanCharacterSideView

|

Boy

Quite a list of “parents,” each of which, through inheritance , provides additional functionality for the Boy class, which, unlike its parents, can actually be implemented, i.e. it can be used for actual WCM characters. We will illustrate the implementation of a new implementable class in a following section. For now, let’s look at modifying the Boy class.


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