• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Sample类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.watabou.noosa.audio.Sample的典型用法代码示例。如果您正苦于以下问题:Java Sample类的具体用法?Java Sample怎么用?Java Sample使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Sample类属于com.watabou.noosa.audio包,在下文中一共展示了Sample类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:19,代码来源:BrokenSeal.java


示例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;
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:27,代码来源:Chasm.java


示例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 );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:20,代码来源:BurningFistSprite.java


示例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));
		}
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:18,代码来源:ItemSprite.java


示例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);

		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:25,代码来源:PotionOfLiquidFlame.java


示例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();
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:27,代码来源:ScrollOfRemoveCurse.java


示例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 );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:26,代码来源:WndBlacksmith.java


示例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;
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:21,代码来源:Chasm.java


示例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;
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:18,代码来源:DeathRay.java


示例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;

	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:26,代码来源:DriedRose.java


示例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();
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:Weightstone.java


示例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 );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:18,代码来源:Goo.java


示例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);
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:20,代码来源:CursingTrap.java


示例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 ) );
		}
	}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:22,代码来源:ItemSprite.java


示例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;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:20,代码来源:Gold.java


示例16: zap

import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
@Override
public void zap(int cell) {

	turnTo(ch.pos, cell);
	play(zap);

	MagicMissile.poison(parent, ch.pos, cell, new Callback() {
		@Override
		public void call() {
			((VioletDragon) ch).onZapComplete();
		}
	});
	Sample.INSTANCE.play(Assets.SND_ZAP);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:15,代码来源:VioletDragonSprite.java


示例17: add

import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public void add(State state) {
	switch (state) {
		case BURNING:
			burning = emitter();
			burning.pour(FlameParticle.FACTORY, 0.06f);
			if (visible) {
				Sample.INSTANCE.play(Assets.SND_BURNING);
			}
			break;
		case LEVITATING:
			levitation = emitter();
			levitation.pour(Speck.factory(Speck.JET), 0.02f);
			break;
		case INVISIBLE:
			PotionOfInvisibility.melt(ch);
			break;
		case PARALYSED:
			paused = true;
			break;
		case FROZEN:
			iceBlock = IceBlock.freeze(this);
			paused = true;
			break;
		case ILLUMINATED:
			GameScene.effect(halo = new TorchHalo(this));
			break;
		case CHILLED:
			chilled = emitter();
			chilled.pour(SnowParticle.FACTORY, 0.1f);
			break;
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:33,代码来源:CharSprite.java


示例18: 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 );
	}

	GameScene.add( Blob.seed( cell, 1000, ParalyticGas.class ) );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:13,代码来源:PotionOfParalyticGas.java


示例19: enter

import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public static void enter( int pos ) {
	Level.set( pos, Terrain.OPEN_DOOR );
	GameScene.updateMap( pos );

	if (Dungeon.visible[pos]) {
		Dungeon.observe();
		Sample.INSTANCE.play( Assets.SND_OPEN );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:10,代码来源:Door.java


示例20: trigger

import com.watabou.noosa.audio.Sample; //导入依赖的package包/类
public static void trigger( int pos, Char ch ) {
	
	for (Mob mob : Dungeon.level.mobs) {
		if (mob != ch) {
			mob.beckon( pos );
		}
	}
	
	if (Dungeon.visible[pos]) {
		GLog.w( "The trap emits a piercing sound that echoes throughout the dungeon!" );
		CellEmitter.center( pos ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
	}
	
	Sample.INSTANCE.play( Assets.SND_ALERT );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:16,代码来源:AlarmTrap.java



注:本文中的com.watabou.noosa.audio.Sample类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SearchMatch类代码示例发布时间:2022-05-21
下一篇:
Java AsyncImageView类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap