本文整理汇总了Java中com.watabou.noosa.audio.Sample类的典型用法代码示例。如果您正苦于以下问题:Java Sample类的具体用法?Java Sample怎么用?Java Sample使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sample类属于com.watabou.noosa.audio包,在下文中一共展示了Sample类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSelect
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public void onSelect( Item item ) {
if (item != null && item instanceof Armor) {
Armor armor = (Armor)item;
if (!armor.levelKnown){
GLog.w(Messages.get(BrokenSeal.class, "unknown_armor"));
} else if (armor.cursed || armor.level() < 0){
GLog.w(Messages.get(BrokenSeal.class, "degraded_armor"));
} else {
GLog.p(Messages.get(BrokenSeal.class, "affix"));
Dungeon.hero.sprite.operate(Dungeon.hero.pos);
Sample.INSTANCE.play(Assets.SND_UNLOCK);
armor.affixSeal((BrokenSeal)curItem);
curItem.detach(Dungeon.hero.belongings.backpack);
Badges.validateTutorial();
}
}
}
示例2: heroFall
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public static void heroFall( int pos ) {
jumpConfirmed = false;
Sample.INSTANCE.play( Assets.SND_FALLING );
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
if (buff != null) buff.detach();
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] ))
if (mob instanceof DriedRose.GhostHero) mob.destroy();
if (Dungeon.hero.isAlive()) {
Dungeon.hero.interrupt();
InterlevelScene.mode = InterlevelScene.Mode.FALL;
if (Dungeon.level instanceof RegularLevel) {
Room room = ((RegularLevel)Dungeon.level).room( pos );
InterlevelScene.fallIntoPit = room != null && room.type == Room.Type.WEAK_FLOOR;
} else {
InterlevelScene.fallIntoPit = false;
}
Game.switchScene( InterlevelScene.class );
} else {
Dungeon.hero.sprite.visible = false;
}
}
示例3: onComplete
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public void onComplete( Animation anim ) {
if (anim == attack) {
Sample.INSTANCE.play( Assets.SND_ZAP );
MagicMissile.shadow( parent, ch.pos, posToShoot,
new Callback() {
@Override
public void call() {
ch.onAttackComplete();
}
} );
idle();
} else {
super.onComplete( anim );
}
}
示例4: drop
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public void drop() {
if (heap.isEmpty()) {
return;
}
dropInterval = DROP_INTERVAL;
speed.set(0, -100);
acc.set(0, -speed.y / DROP_INTERVAL * 2);
if (visible && heap != null && heap.peek() instanceof Gold) {
CellEmitter.center(heap.pos).burst(Speck.factory(Speck.COIN), 5);
Sample.INSTANCE.play(Assets.SND_GOLD, 1, 1,
Random.Float(0.9f, 1.1f));
}
}
示例5: shatter
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public void shatter(int cell) {
if (Dungeon.visible[cell]) {
setKnown();
splash(cell);
Sample.INSTANCE.play(Assets.SND_SHATTER);
}
for (int offset : PathFinder.NEIGHBOURS9) {
if (Level.flamable[cell + offset]
|| Actor.findChar(cell + offset) != null
|| Dungeon.level.heaps.get(cell + offset) != null) {
GameScene.add(Blob.seed(cell + offset, 2, Fire.class));
} else {
CellEmitter.get(cell + offset).burst(FlameParticle.FACTORY, 2);
}
}
}
示例6: doRead
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
protected void doRead() {
new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
Sample.INSTANCE.play( Assets.SND_READ );
Invisibility.dispel();
boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) );
procced = uncurse( curUser,
curUser.belongings.weapon,
curUser.belongings.armor,
curUser.belongings.ring1,
curUser.belongings.ring2 ) || procced;
Weakness.detach( curUser, Weakness.class );
if (procced) {
GLog.p( TXT_PROCCED );
} else {
GLog.i( TXT_NOT_PROCCED );
}
setKnown();
readAnimation();
}
示例7: createChildren
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
protected void createChildren() {
super.createChildren();
bg = Chrome.get( Chrome.Type.BUTTON );
add( bg );
slot = new ItemSlot() {
@Override
protected void onTouchDown() {
bg.brightness( 1.2f );
Sample.INSTANCE.play( Assets.SND_CLICK );
};
@Override
protected void onTouchUp() {
bg.resetColor();
}
@Override
protected void onClick() {
ItemButton.this.onClick();
}
};
slot.enable(true);
add( slot );
}
示例8: heroFall
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public static void heroFall( int pos ) {
jumpConfirmed = false;
Sample.INSTANCE.play( Assets.SND_FALLING );
if (Dungeon.hero.isAlive()) {
Dungeon.hero.interrupt();
InterlevelScene.mode = InterlevelScene.Mode.FALL;
if (Dungeon.level instanceof RegularLevel) {
Room room = ((RegularLevel)Dungeon.level).room( pos );
InterlevelScene.fallIntoPit = room != null && room.type == Room.Type.WEAK_FLOOR;
} else {
InterlevelScene.fallIntoPit = false;
}
Game.switchScene( InterlevelScene.class );
} else {
Dungeon.hero.sprite.visible = false;
}
}
示例9: DeathRay
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public DeathRay( PointF s, PointF e ) {
super( Effects.get( Effects.Type.RAY ) );
origin.set( 0, height / 2 );
x = s.x - origin.x;
y = s.y - origin.y;
float dx = e.x - s.x;
float dy = e.y - s.y;
angle = (float)(Math.atan2( dy, dx ) * A);
scale.x = (float)Math.sqrt( dx * dx + dy * dy ) / width;
Sample.INSTANCE.play( Assets.SND_RAY );
timeLeft = DURATION;
}
示例10: doPickUp
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public boolean doPickUp( Hero hero ) {
DriedRose rose = hero.belongings.getItem( DriedRose.class );
if (rose == null){
GLog.w( Messages.get(this, "no_rose") );
return false;
} if ( rose.level() >= rose.levelCap ){
GLog.i( Messages.get(this, "no_room") );
hero.spendAndNext(TIME_TO_PICK_UP);
return true;
} else {
rose.upgrade();
if (rose.level() == rose.levelCap) {
GLog.p( Messages.get(this, "maxlevel") );
} else
GLog.i( Messages.get(this, "levelup") );
Sample.INSTANCE.play( Assets.SND_DEWDROP );
hero.spendAndNext(TIME_TO_PICK_UP);
return true;
}
}
示例11: apply
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
private void apply(Weapon weapon, boolean forSpeed) {
detach(curUser.belongings.backpack);
if (forSpeed) {
weapon.imbue = Weapon.Imbue.LIGHT;
GLog.p(TXT_LIGHT, weapon.name());
} else {
weapon.imbue = Weapon.Imbue.HEAVY;
GLog.p(TXT_HEAVY, weapon.name());
}
curUser.sprite.operate(curUser.pos);
Sample.INSTANCE.play(Assets.SND_MISS);
curUser.spend(TIME_TO_APPLY);
curUser.busy();
}
示例12: damageRoll
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public int damageRoll() {
int min = 1;
int max = (HP*2 <= HT) ? 15 : 10;
if (pumpedUp > 0) {
pumpedUp = 0;
PathFinder.buildDistanceMap( pos, BArray.not( Level.solid, null ), 2 );
for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE)
CellEmitter.get(i).burst(ElmoParticle.FACTORY, 10);
}
Sample.INSTANCE.play( Assets.SND_BURNING );
return Random.NormalIntRange( min*3, max*3 );
} else {
return Random.NormalIntRange( min, max );
}
}
示例13: activate
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public void activate() {
if (Dungeon.visible[ pos ]) {
CellEmitter.get(pos).burst(ShadowParticle.UP, 5);
Sample.INSTANCE.play(Assets.SND_CURSED);
}
Heap heap = Dungeon.level.heaps.get( pos );
if (heap != null){
for (Item item : heap.items){
if (item.isUpgradable())
curse(item);
}
}
if (Dungeon.hero.pos == pos){
curse(Dungeon.hero);
}
}
示例14: drop
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public void drop() {
if (heap.isEmpty()) {
return;
} else if (heap.size() == 1){
// normally this would happen for any heap, however this is not applied to heaps greater than 1 in size
// in order to preserve an amusing visual bug/feature that used to trigger for heaps with size > 1
// where as long as the player continually taps, the heap sails up into the air.
place(heap.pos);
}
dropInterval = DROP_INTERVAL;
speed.set( 0, -100 );
acc.set(0, -speed.y / DROP_INTERVAL * 2);
if (visible && heap != null && heap.peek() instanceof Gold) {
CellEmitter.center( heap.pos ).burst( Speck.factory( Speck.COIN ), 5 );
Sample.INSTANCE.play( Assets.SND_GOLD, 1, 1, Random.Float( 0.9f, 1.1f ) );
}
}
示例15: doPickUp
import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public boolean doPickUp( Hero hero ) {
Dungeon.gold += quantity;
Statistics.goldCollected += quantity;
Badges.validateGoldCollected();
MasterThievesArmband.Thievery thievery = hero.buff(MasterThievesArmband.Thievery.class);
if (thievery != null)
thievery.collect(quantity);
GameScene.pickUp( this );
hero.sprite.showStatus( CharSprite.NEUTRAL, TXT_VALUE, quantity );
hero.spendAndNext( TIME_TO_PICK_UP );
Sample.INSTANCE.play( Assets.SND_GOLD, 1, 1, Random.Float( 0.9f, 1.1f ) );
return true;
}