当前位置: 首页>>代码示例>>Java>>正文


Java Debug.d方法代码示例

本文整理汇总了Java中org.andengine.util.debug.Debug.d方法的典型用法代码示例。如果您正苦于以下问题:Java Debug.d方法的具体用法?Java Debug.d怎么用?Java Debug.d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.andengine.util.debug.Debug的用法示例。


在下文中一共展示了Debug.d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fail

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void fail(Word word, final float wordX) {
    Debug.d("NumberMatchGame : fail!");
    GameSounds.play(GameSounds.FAILED);
    float available_width = (this.cardPane.getWidth()/this.max_choices);
    float wordY = this.resultsPane.getHeight() + this.cardPane.getHeight() - 150;

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite missed_sprite = new Sprite(wordX+(available_width/2), wordY, sprite_region.getTextureRegion(2), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(missed_sprite);
    missed_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, wordY, 80),
            new MoveXModifier(0.5f, wordX + (available_width / 2), 48 + (this.result_number * 80))
    ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:17,代码来源:NumberMatchGameHUD.java

示例2: setManagedHUD

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
public void setManagedHUD(PhoeniciaHUD hud, IOnSceneTouchListener touchListener) {
    if (hud == null) {
        this.clearManagedHUD();
        return;
    }
    if (this.managedHUD != null) {
        this.detachChild(this.managedHUD);
    }
    this.managedHUD = hud;
    Debug.d("Attaching HUD to tour overlay: " + hud);
    this.game.hudManager.setHudLayerVisible(false);
    this.attachChild(this.managedHUD);
    this.managedHUD.setZIndex(this.messageBox.getZIndex() - 1);
    this.sortChildren();

    if (touchListener != null) {
        this.managedHUD.setOnSceneTouchListener(touchListener);
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:20,代码来源:TourOverlay.java

示例3: pass

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void pass(Word word, final float wordX) {
    //TODO: count success
    Debug.d("ImageMatchGame : pass!");
    GameSounds.play(GameSounds.COMPLETE);
    this.winnings.add(word);
    float available_width = (this.cardPane.getWidth()/this.max_choices);
    float wordY = this.resultsPane.getHeight() + this.cardPane.getHeight() - 150;

    ITiledTextureRegion sprite_region = this.game.wordSprites.get(word);
    Sprite winning_sprite = new Sprite(wordX+(available_width/2), wordY, sprite_region.getTextureRegion(1), PhoeniciaContext.vboManager);
    this.resultsPane.attachChild(winning_sprite);
    winning_sprite.registerEntityModifier(new ParallelEntityModifier(
            new ScaleModifier(0.5f, 2.0f, 1.0f),
            new MoveYModifier(0.5f, wordY, 80),
            new MoveXModifier(0.5f, wordX+(available_width/2), 40+(this.result_number*80))
            ));
    this.result_number++;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:19,代码来源:ImageMatchGameHUD.java

示例4: subtract

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
 * Decrement the quantity of an InventoryItem.
 *
 * Throws an exception if there are no items matching this name in the player's inventory
 * /TODO: Properly handle cases when subtracting an item isn't allowed
 * @param inventory_id name of the InventoryItem
 * @return the new quantity of this item
 */
public int subtract(final String inventory_id, final int quantity) throws Exception {
    Debug.d("Subtracting item: " + inventory_id);
    final Filter filter = new Filter();
    filter.is("item_name", inventory_id);
    try {
        InventoryItem item = InventoryItem.objects(PhoeniciaContext.context).filter(this.session.filter).filter(filter).toList().get(0);
        if (item != null) {
            final int count = item.quantity.get() - quantity;
            item.quantity.set(count);
            item.save(PhoeniciaContext.context);
            this.inventoryUpdated(item);
            return count;
        }
    } catch (IndexOutOfBoundsException e) {
        throw new Exception("Can not subtract item "+inventory_id+" from inventory because it has none");
    }
    return 0;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:27,代码来源:Inventory.java

示例5: get

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
 * Get an InventoryItem by name
 *
 * @param inventory_id name of the InventoryItem
 * @return an existing InventoryItem from the inventory, or a new one with 0 quantity
 */
public InventoryItem get(String inventory_id) {
    final Filter filter = new Filter();
    filter.is("item_name", inventory_id);
    InventoryItem item;
    try {
        item = InventoryItem.objects(PhoeniciaContext.context).filter(this.session.filter).filter(filter).toList().get(0);
        if (item != null) {
            return item;
        }
    } catch (IndexOutOfBoundsException e) {
        Debug.d("No record for " + inventory_id + ", creating a new one");
    }
    item = new InventoryItem();
    item.item_name.set(inventory_id);
    item.quantity.set(0);
    item.history.set(0);
    return item;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:25,代码来源:Inventory.java

示例6: clear

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
 * Aport spelling attempt and return used letters to the player's Inventory
 */
public synchronized void clear() {
    Debug.d("Clearing");
    PhoeniciaContext.activity.runOnUpdateThread(new Runnable() {
        @Override
        public void run() {
            cursorAt = 0;
            for (int i = 0; i < buildWord.chars.length; i++) {
                if (charSprites[i] != null) {
                    buildPane.detachChild(charSprites[i]);
                    charSprites[i] = null;
                }
                if (spelling[i] != ' ') {
                    usedCounts.put(new String(spelling, i, 1), 0);
                    InventoryItem[] items = {Inventory.getInstance().get(new String(spelling, i, 1))};
                    onInventoryUpdated(items);
                }
                spelling[i] = ' ';

            }
        }
    });
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:26,代码来源:WordBuilderHUD.java

示例7: putChar

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
 * Add the given letter to the next space in the spelling sequence for the word
 * @param letter Letter to add to the proposed spelling
 */
public void putChar(Letter letter) {
    if (this.cursorAt >= MAX_WORD_SIZE) {
        Debug.d("Too many characters!");
        return;
    }
    final int startX = 200 - (this.spelling.length * 35) + 35; // TODO: replace magic numbers
    final ITextureRegion blockRegion = game.letterSprites.get(letter).getTextureRegion(0);
    final Sprite character = new Sprite(this.charBlocksX[cursorAt], this.charBlocksY[cursorAt], blockRegion, PhoeniciaContext.vboManager);
    this.buildPane.attachChild(character);
    this.charSprites[this.cursorAt] = character;
    this.spelling[cursorAt] = letter.chars[0];
    this.cursorAt++;

    this.game.playBlockSound(letter.phoneme);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:20,代码来源:WorkshopHUD.java

示例8: experienceChanged

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void experienceChanged(int new_xp) {
    Debug.d("Experience points changed");
    for (int i = 0; i < this.listeners.size(); i++) {
        Debug.d("Calling update listener: "+this.listeners.get(i).getClass());
        this.listeners.get(i).onExperienceChanged(new_xp);
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:8,代码来源:GameSession.java

示例9: showMessage

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
public void showMessage(Message message, MessageBox position, final boolean showNextButton, final MediaPlayer.OnCompletionListener listener) {
    String messageText = message.text;
    String messageSound = message.sound;

    this.messageBox.detachChildren();
    this.nextButton.setVisible(false);
    this.messageBox.attachChild(this.nextButton);

    this.positionMessageBox(position);
    this.displayText = new Text(this.messageBox.getWidth()/2+16, this.messageBox.getHeight()/2, GameFonts.introText(), messageText, messageText.length(), new TextOptions(HorizontalAlign.LEFT), PhoeniciaContext.vboManager);
    this.displayText.setAutoWrapWidth(this.messageBox.getWidth() - 32);
    this.displayText.setAutoWrap(AutoWrap.WORDS);

    this.messageBox.setHeight(this.displayText.getHeight() + 64);
    this.displayText.setPosition(this.messageBox.getWidth() / 2 + 16, this.messageBox.getHeight() - (this.displayText.getHeight() / 2));

    this.messageBox.attachChild(this.displayText);
    if (messageSound != null && messageSound.length() > 0) {
        Debug.d("Playing tour message sound: '" + messageSound + "'");
        this.messagePlaying = true;
        this.game.playLevelSound(messageSound, new MediaPlayer.OnCompletionListener() {
            @Override
            public void onCompletion(MediaPlayer mp) {
                messagePlaying = false;
                if (listener != null) {
                    listener.onCompletion(mp);
                }
                if (showNextButton) {
                    nextButton.setVisible(true);
                }
            }
        });
    }


}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:37,代码来源:TourOverlay.java

示例10: onClick

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
@Override
public void onClick(ClickDetector clickDetector, int i, float v, float v1) {
    long newTime = System.currentTimeMillis();
    if (newTime - firstClick > timeToTrigger) {
        clickCount = 0;
        firstClick = newTime;
    }
    clickCount++;

    Debug.d("Click count: "+clickCount);
    if (clickCount >= clicksToTrigger) {
        this.onRepeatedClick(clickDetector, i, v, v1);
        clickCount = 0;
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:16,代码来源:RepeatedClickDetectorListener.java

示例11: onClicked

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
@Override
public void onClicked() {
    Debug.d("WorkshopStop clicked");
    if (this.currentMessageIndex != MSG_MAPBLOCK && this.currentMessageIndex != MSG_SPELLING) {
        this.next();
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:8,代码来源:WorkshopStop.java

示例12: check

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
 * See if all #requirements for this level have been fulfilled
 * @param context ApplicationContext needed for database access
 * @return true if all requirements pass, otherwise false
 */
public boolean check(Context context) {
    Debug.d("Checking if player passes level " + name);
    for (int i = 0; i < requirements.size(); i++) {
        Debug.d("Checking "+requirements.get(i));
        if (!requirements.get(i).check(context)) {
            // abort on the first requirement failure
            return false;
        }
    }
    return true;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:17,代码来源:Level.java

示例13: sellLetter

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
protected void sellLetter(LetterSprite block) {
    try {
        Inventory.getInstance().subtract(block.getLetter().name);
        Bank.getInstance().credit(block.getLetter().sell);
        final int newCount = Inventory.getInstance().getCount(block.getLetter().name);
        block.setCount(newCount);
        if (newCount < 1) {
            block.setEnabled(false);
        }
        GameSounds.play(GameSounds.COLLECT);
    } catch (Exception e) {
        Debug.d("Could not sell "+block.getLetter().name, e);

    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:16,代码来源:InventoryHUD.java

示例14: loadSessionWords

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
private void loadSessionWords() {
    Debug.d("Loading word tiles");
    List<WordTile> wordTiles = WordTile.objects(PhoeniciaContext.context).filter(session.filter).toList();
    for (int i = 0; i < wordTiles.size(); i++) {
        WordTile wordTile = wordTiles.get(i);
        Debug.d("Restoring tile "+wordTile.item_name.get());
        wordTile.word = this.locale.word_map.get(wordTile.item_name.get());
        // In case a word was removed from the locale
        if (!this.locale.word_map.containsKey(wordTile.item_name.get())) continue;
        wordTile.phoeniciaGame = this;
        WordTileBuilder builder = wordTile.getBuilder(PhoeniciaContext.context);
        if (builder == null) {
            Debug.d("Adding new builder for tile " + wordTile.item_name.get());
            builder = new WordTileBuilder(this.session, wordTile, wordTile.item_name.get(), wordTile.word.construct);
            builder.save(PhoeniciaContext.context);
            builder.start();
        } else {
            builder.time.set(wordTile.word.construct);
            // If builder is market complete, set the progress to the build time in case it was changed in the locale
            if (builder.status.get() == Builder.COMPLETE) {
                builder.progress.set(wordTile.word.construct);
            }
            builder.save(PhoeniciaContext.context);
            Debug.d("Found builder with "+builder.progress.get()+"/"+builder.time.get()+" and status "+builder.status.get());
        }
        wordTile.setBuilder(builder);
        wordTile.save(PhoeniciaContext.context);
        this.addBuilder(builder);

        this.createWordSprite(wordTile);
        wordTile.restart(PhoeniciaContext.context);
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:34,代码来源:PhoeniciaGame.java

示例15: show

import org.andengine.util.debug.Debug; //导入方法依赖的package包/类
/**
 * Animate the opacity of the sprite being moved
 */
@Override
public void show() {
    this.originalTileIndex = this.sprite.getCurrentTileIndex();
    this.sprite.stopAnimation();
    this.sprite.setCurrentTileIndex(0);
    this.checkPlacement(this.newLocation);
    Debug.d("Sprite placement restriction: "+this.restriction);
    whiteRect.registerEntityModifier(new MoveYModifier(0.5f, -48, 64, EaseBackOut.getInstance()));
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:SpriteMoveHUD.java


注:本文中的org.andengine.util.debug.Debug.d方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。