Thank you for visiting Blazing Games

Plotting the Path

The planets from which the path are made are buttons. Clicking on a button goes to an event which causes the planet tied to the button to be added to the path list. The function that adds the planet to the path list also draws the path using the Flash graphics API.

function handlePlanet(evt:Event)
{
    for (var cntr:int = 0; cntr < planetArray.length; ++cntr)
        if (evt.target == planetArray[cntr])
            addPlanetToPath(cntr);
}

function addPlanetToPath(planetID:int)
{
    trace ("Adding planet number " + planetID);
    if (visitFlags[planetID] == false) {
        visitFlags[planetID] = true;
        score += 5;
    }
    pathArray.push(planetID);
    graphics.clear();
    graphics.lineStyle(3, 0xff00ff);
    graphics.moveTo(ship_movie.x, ship_movie.y);
    for (var cntr:int = 0; cntr < pathArray.length; ++cntr)
        graphics.lineTo(planetArray[pathArray[cntr]].x, planetArray[pathArray[cntr]].y);
    if (planetID == 7) {
        lastPlanetVisitedIndex = 0;
        graphics.clear();
        gotoNextPlanet();
    }
}

The path animation simply goes through the path array that was created by the addPlanetToPath() function and calls the appropriate starting frame. The end of the animated segment has a URL-style continue button which calls the handleContinueURL() function which starts the next part of the fly-by.

function handleContinueURL(evt:Event)
{
    hidePlanetText();
    gotoNextPlanet();
}

function showPlanetText(planet:String, info:String)
{
    planet_txt.text = " ";
    info_txt.text = " ";
    planet_txt.visible = true;
    info_txt.visible = true;
    conURL_btn.visible = true;
    planetAnimation.setText(planet_txt, planet, AnimatedText.EXPLODINGTEXT, 5);
    infoAnimation.setText(info_txt, info, AnimatedText.SLOWTEXT, 20);
}

function hidePlanetText()
{
    planet_txt.text = " ";
    info_txt.text = " ";
    planet_txt.visible = false;
    info_txt.visible = false;
    conURL_btn.visible = false;
}

If I would have time and resources when creating this episode, real planet photos would probably been used and instead of text a voice-over done by a professional would have read the text as the animation of the fly-by was being played there-by making the entire path seamless. The path plotting may have also had undo features and start trip option allowing the player to finish the episode without visiting Neptune and facing Ykcul's wraith. The source is now in the open so if somebody wishes to implement any of my ideas for enhancing the episode I would love to see them.

Previous page
Chapter 36 Page 5

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2009 Blazing Games Inc. All Rights Reserved