----------------- Part 1 ----------------- Code Sample 1.1 " function mole::onAdd(%this) { // enable mouse events for the mole so we can easily determine when it is clicked on %this.setUseMouseEvents( true ); } " Code Sample 1.2 " function mole::onMouseDown(%this, %modifier, %worldPosition, %mouseClicks) { if( %this.getAnimationName() $= ("animMoleComeOut" @ %this.moleColor) ) %this.playAnimation( "animMoleWhacked" @ %this.moleColor ); } " Code Sample 1.3 " function mole::onAnimationEnd(%this) { if( %this.getAnimationName() !$= ("animMoleComeOut" @ %this.moleColor) ) %this.safeDelete(); } " Code Sample 1.4 " function startGame(%level) { //exec game scripts exec("./mole.cs"); // Set The GUI. Canvas.setContent(mainScreenGui); Canvas.setCursor(DefaultCursor); moveMap.push(); // this has been added: sceneWindow2D.setUseObjectMouseEvents( true ); if( isFile( %level ) || isFile( %level @ ".dso")) sceneWindow2D.loadLevel(%level); } "