Android Open Source - ninja-trials Achievement Set Ninja Trial






From Project

Back to project page ninja-trials.

License

The source code is released under:

Apache License

If you think the Android project ninja-trials listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Ninja Trials is an old school style Android Game developed for OUYA & using
 * AndEngine. It features several minigames with simple gameplay.
 * Copyright 2013 Mad Gear Games <madgeargames@gmail.com>
 */*  w  w  w .j a  v a 2 s  . c  o m*/
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.madgear.ninjatrials.achievements;

import java.io.Serializable;

import com.madgear.ninjatrials.R;
import com.madgear.ninjatrials.managers.GameManager;
import com.madgear.ninjatrials.managers.ResourceManager;

public class AchievementSetNinjaTrial extends AchievementSet implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final int ACHIEV_NUM = 35;

    // ACHIEV. PROGRESSION VALUES:
    private static final int ACHIEV_01_TOTAL_MS = 200000;
    private static final int ACHIEV_01_TOTAL_MS_TEST = 300;
    private static final int ACHIEV_02_TOTAL_STRAWMEN = 500;
    private static final int ACHIEV_02_TOTAL_STRAWMEN_TEST = 15;
    private static final int ACHIEV_03_TOTAL_PERFECT_JUMPS = 100;
    private static final int ACHIEV_03_TOTAL_PERFECT_JUMPS_TEST = 10;
    private static final int ACHIEV_05_TOTAL_MINUTES = 100*60;
    private static final int ACHIEV_05_TOTAL_MINUTES_TEST = 5;

    // ACHIEV. DATA:
    public static final int ACHIEV_04_CUT_PRECISSION = 100;
    public static final int ACHIEV_04_CUT_PRECISSION_TEST = 80;

    
    public AchievementSetNinjaTrial() {
        super(ACHIEV_NUM);
        init();
    }
    
    
    /**
     * Initializes the Ninja Trials achiev. set.
     */
    public void init() {
        // Default setup
        for(int i = 0; i < ACHIEV_NUM; i++) {
            achievements[i] = new Achievement("Nombre"+(i+1), "Descrp"+(i+1), "Exito"+(i+1));
        }
        
        // Achiev 1: Run a total of 200 Km
        achievements[0] = new Achievement(
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_01_name),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_01_desc),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_01_success),
                0, GameManager.ACHIEV_DEBUG_MODE ? ACHIEV_01_TOTAL_MS_TEST : ACHIEV_01_TOTAL_MS);
        
        // Achiev 2: Destroy 500 StrawMen
        achievements[1] = new Achievement(
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_02_name),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_02_desc),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_02_success),
                0, GameManager.ACHIEV_DEBUG_MODE ? ACHIEV_02_TOTAL_STRAWMEN_TEST : ACHIEV_02_TOTAL_STRAWMEN);
        
        // Achiev 3: Perform 100 perfect jumps
        achievements[2] = new Achievement(
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_03_name),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_03_desc),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_03_success),
                0, GameManager.ACHIEV_DEBUG_MODE ? ACHIEV_03_TOTAL_PERFECT_JUMPS_TEST : ACHIEV_03_TOTAL_PERFECT_JUMPS);
        
        // Achiev 4: Achieve a single cut with 100% precision.
        achievements[3] = new Achievement(
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_04_name),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_04_desc),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_04_success));
        
        // Achiev 5: Play the game for at least 100 hours.
        achievements[4] = new Achievement(
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_05_name),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_05_desc),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_05_success),
                0, GameManager.ACHIEV_DEBUG_MODE ? ACHIEV_05_TOTAL_MINUTES_TEST : ACHIEV_05_TOTAL_MINUTES,
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_05_clue_tittle),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_05_clue_desc));
        
        // Achiev 6: Get all default records replaced by players records.
        achievements[5] = new Achievement(
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_06_name),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_06_desc),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_06_success),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_06_clue_tittle),
                ResourceManager.getInstance().loadAndroidRes().getString(R.string.achievement_06_clue_desc));    

        
        /*
        // EXAMPLES:
        
        // basic:
        achievements[0] = new Achievement("Basic", "Descripion basic", "Success basic!!!");
        
        // basic success:
        achievements[1] = new Achievement("Basic", "Descripion basic", "Success basic!!!");
        achievements[1].completed = true;
        
        // Progressive:
        achievements[2] = new Achievement("Progressive", "Description progressive",
                "Success progresive!!!", 0, 100);
        
        // Progressive success:
        achievements[3] = new Achievement("Progressive", "Description progressive",
                "Success progresive!!!", 0, 100);
        achievements[3].completed = true;
        
        // Secret:
        achievements[4] = new Achievement("Secret", "Description Secret", "Sucess secret!!!",
                "Clue name", "Clue description");
        
        // Secret success:
        achievements[5] = new Achievement("Secret", "Description Secret", "Sucess secret!!!",
                "Clue name", "Clue description");
        achievements[5].completed = true;
        
        // Progressive & Secret:
        achievements[6] = new Achievement("Prog and Sec", "Description progress and secret",
                "Sucess prog and secret!!!", 0, 100,
                "Clue name prog and sec", "Clue description prog and sec");
        
        // Progressive & Secret sucess:
        achievements[7] = new Achievement("Prog and Sec", "Description progress and secret",
                "Sucess prog and secret!!!", 0, 100,
                "Clue name prog and sec", "Clue description prog and sec");
        achievements[7].completed = true;

*/
    }
}




Java Source Code List

com.madgear.ninjatrials.AchievementsScene.java
com.madgear.ninjatrials.CharacterIntroScene.java
com.madgear.ninjatrials.ControllerOptionsScene.java
com.madgear.ninjatrials.DummyMenu.java
com.madgear.ninjatrials.GameScene.java
com.madgear.ninjatrials.IUserInput.java
com.madgear.ninjatrials.MainMenuScene.java
com.madgear.ninjatrials.MainOptionsScene.java
com.madgear.ninjatrials.ManagedLayer.java
com.madgear.ninjatrials.ManagedScene.java
com.madgear.ninjatrials.MapScene.java
com.madgear.ninjatrials.NinjaTrials.java
com.madgear.ninjatrials.PlayerSelectionScene.java
com.madgear.ninjatrials.RecordsScene.java
com.madgear.ninjatrials.ResultLoseScene.java
com.madgear.ninjatrials.ResultTrial.java
com.madgear.ninjatrials.ResultWinScene.java
com.madgear.ninjatrials.achievements.AchievementSetNinjaTrial.java
com.madgear.ninjatrials.achievements.AchievementSet.java
com.madgear.ninjatrials.achievements.Achievement.java
com.madgear.ninjatrials.hud.AchievementNotify.java
com.madgear.ninjatrials.hud.Chronometer.java
com.madgear.ninjatrials.hud.GameHUD.java
com.madgear.ninjatrials.hud.HeadCharacter.java
com.madgear.ninjatrials.hud.PowerBar.java
com.madgear.ninjatrials.hud.PrecisionAngleBar.java
com.madgear.ninjatrials.hud.PrecisionBar.java
com.madgear.ninjatrials.hud.SelectionStripe.java
com.madgear.ninjatrials.hud.ShurikenEnemyCounter.java
com.madgear.ninjatrials.hud.VolumeBar.java
com.madgear.ninjatrials.layers.GameOverLayer.java
com.madgear.ninjatrials.managers.GameManager.java
com.madgear.ninjatrials.managers.ResourceManager.java
com.madgear.ninjatrials.managers.SFXManager.java
com.madgear.ninjatrials.managers.SceneManager.java
com.madgear.ninjatrials.managers.UserData.java
com.madgear.ninjatrials.records.Record.java
com.madgear.ninjatrials.records.RecordsTableSet.java
com.madgear.ninjatrials.records.RecordsTable.java
com.madgear.ninjatrials.sequences.CreditsScene.java
com.madgear.ninjatrials.sequences.EndingScene.java
com.madgear.ninjatrials.sequences.EndingSequenceRyokoEasy.java
com.madgear.ninjatrials.sequences.EndingSequenceShoEasy.java
com.madgear.ninjatrials.sequences.Intro1Scene.java
com.madgear.ninjatrials.sequences.Intro2Scene.java
com.madgear.ninjatrials.sequences.Intro2SequenceRyokoEasy.java
com.madgear.ninjatrials.sequences.Intro2SequenceShoEasy.java
com.madgear.ninjatrials.sequences.Sequence.java
com.madgear.ninjatrials.sequences.SplashIntroScene.java
com.madgear.ninjatrials.trials.TrialSceneCut.java
com.madgear.ninjatrials.trials.TrialSceneJump.java
com.madgear.ninjatrials.trials.TrialSceneRun.java
com.madgear.ninjatrials.trials.TrialSceneShuriken.java
com.madgear.ninjatrials.trials.run.RunBg.java
com.madgear.ninjatrials.trials.run.RunCharacter.java
com.madgear.ninjatrials.trials.shuriken.ShurikenCoordinates.java
com.madgear.ninjatrials.trials.shuriken.ShurikenEnemy.java
com.madgear.ninjatrials.trials.shuriken.ShurikenHands.java
com.madgear.ninjatrials.trials.shuriken.ShurikenShuriken.java
com.madgear.ninjatrials.utils.AutoDiagonalParallaxBackground.java
com.madgear.ninjatrials.utils.AutoHorizontalParallaxBackground.java
com.madgear.ninjatrials.utils.AutoVerticalParallaxBackground.java
com.madgear.ninjatrials.utils.ParallaxBackground2d.java