view paper_shooting/resources/title.js @ 25:158b846e3874

paper
author <e085737>
date Mon, 14 Feb 2011 16:37:16 +0900
parents
children 6468848f4d22
line wrap: on
line source

function createTitle(sgroot, w, h){
    var game = new sgroot.createSceneGraph1("Game");
    game.xyz[0] =  20;
    game.xyz[1] =  100;
    game.xyz[2] = -50;
    game.angle[0] = 90;
    game.scale = 0.3;
    game.set_move_collision(no_move_idle, title_collision);

    var start = new sgroot.createSceneGraph1("Start");
    start.xyz[0] = -10;
    start.xyz[1] = 0;
    start.xyz[2] = -80;
    start.set_move_collision(no_move_idle, no_collision_idle);

    game.addChild(start);

    return game;
}
     

function title_collision(node, sgroot, w, h){
    var pad = new sgroot.getController();

    if(pad.start_isHold()){
	    sgroot.setSceneData(node.next);
    }
}


function game_over_collision(node, sgroot, w, h){
    var pad = new sgroot.getController();

    if(pad.start_isHold()){
        sgroot.setSceneData(node.restart);
    }
}


function ending_collision(node, sgroot, w, h){
    var pad = new sgroot.getController();

    if(pad.start_isHold()){
        sgroot.setSceneData(node.start);
    }
}