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

Java PointF类代码示例

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

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



PointF类属于com.watabou.utils包,在下文中一共展示了PointF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {
	super.update();

	if (phase < 1) {
		if ((phase -= Game.elapsed) <= 0) {
			killAndErase();
		} else {
			scale.set((2 - phase) * radius / RADIUS);
			am = phase * (-1);
			aa = phase * (+1);
		}
	}

	if (visible = WandmakerSprite.this.visible) {
		PointF p = WandmakerSprite.this.center();
		point(p.x, p.y);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:20,代码来源:WandmakerSprite.java


示例2: onTouchDown

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
protected void onTouchDown(Touch t) {

	if (t != touch && another == null) {

		if (!touch.down) {
			touch = t;
			onTouchDown(t);
			return;
		}

		pinching = true;

		another = t;
		startSpan = PointF.distance(touch.current, another.current);
		startZoom = camera.zoom;

		dragging = false;
	} else if (t != touch) {
		reset();
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:23,代码来源:CellSelector.java


示例3: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {
	if ((spent += Game.elapsed) > duration) {

		killAndErase();
		if (callback != null) {
			callback.call();
		}

	} else {
		float dx = to.x - from.x;
		float dy = to.y - from.y;
		for (int i = 0; i < chains.length; i++) {
			chains[i].center(new PointF(
					from.x + ((dx * (i / (float)chains.length)) * (spent/duration)),
					from.y + ((dy * (i / (float)chains.length)) * (spent/duration))
			));
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:21,代码来源:Chains.java


示例4: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {

	if (visible = Dungeon.visible[pos]) {

		super.update();

		if ((delay -= Game.elapsed) <= 0) {

			delay = Random.Float();

			PointF p = DungeonTilemap.tileToWorld(pos);
			((Sparkle) recycle(Sparkle.class)).reset(
					p.x + Random.Float(DungeonTilemap.SIZE), p.y
							+ Random.Float(DungeonTilemap.SIZE));
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:MineLevel.java


示例5: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {
	
	if (visible = Dungeon.visible[pos]) {
		
		super.update();
		
		if ((delay -= Game.elapsed) <= 0) {
			
			delay = Random.Float();
			
			PointF p = DungeonTilemap.tileToWorld( pos );
			((Sparkle)recycle( Sparkle.class )).reset( 
				p.x + Random.Float( DungeonTilemap.SIZE ), 
				p.y + Random.Float( DungeonTilemap.SIZE ) );
		}
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:19,代码来源:CavesLevel.java


示例6: Beam

import com.watabou.utils.PointF; //导入依赖的package包/类
private Beam(PointF s, PointF e, Effects.Type asset, float duration) {
	super(Effects.get(asset));

	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 = this.duration = duration;
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:18,代码来源:Beam.java


示例7: reset

import com.watabou.utils.PointF; //导入依赖的package包/类
public void reset(int from, int to, Callback callback) {
	this.callback = callback;

	revive();

	PointF pf = DungeonTilemap.tileCenterToWorld(from);
	PointF pt = DungeonTilemap.tileCenterToWorld(to);

	x = pf.x;
	y = pf.y;
	width = 0;
	height = 0;

	PointF d = PointF.diff(pt, pf);
	PointF speed = new PointF(d).normalize().scale(SPEED);
	sx = speed.x;
	sy = speed.y;
	time = d.length() / SPEED;
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:20,代码来源:MagicMissile.java


示例8: reset

import com.watabou.utils.PointF; //导入依赖的package包/类
public void reset( int from, int to, float velocity, Callback callback ) {
	this.callback = callback;
	
	revive();
	
	PointF pf = DungeonTilemap.tileCenterToWorld( from );
	PointF pt = DungeonTilemap.tileCenterToWorld( to );
	
	x = pf.x;
	y = pf.y;
	width = 0;
	height = 0;
	
	PointF d = PointF.diff( pt, pf ); 
	PointF speed = new PointF( d ).normalize().scale( velocity );
	sx = speed.x;
	sy = speed.y;
	time = d.length() / velocity;
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:20,代码来源:MagicMissile.java


示例9: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (!visible) {
		visible = Dungeon.level.visited[cell] || Dungeon.level.mapped[cell];
	}
	
	if (visible) {
		PointF scroll = Camera.main.scroll;
		if (!scroll.equals( lastScroll )) {
			lastScroll.set( scroll );
			PointF center = Camera.main.center().offset( scroll );
			angle = (float)Math.atan2( cellCenter.x - center.x, center.y - cellCenter.y ) * RAD_2_G;
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:18,代码来源:Compass.java


示例10: reset

import com.watabou.utils.PointF; //导入依赖的package包/类
public void reset( int from, int to, float velocity, Callback callback ) {
	this.callback = callback;
	
	revive();
	
	PointF pf = DungeonTilemap.tileCenterToWorld( from );
	PointF pt = DungeonTilemap.tileCenterToWorld( to );
	
	x = pf.x;
	y = pf.y;
	width = 0;
	height = 0;
	
	PointF d = PointF.diff( pt, pf );
	PointF speed = new PointF( d ).normalize().scale( velocity );
	sx = speed.x;
	sy = speed.y;
	time = d.length() / velocity;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:20,代码来源:MagicMissile.java


示例11: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {
	
	if (visible = Dungeon.visible[pos]) {
		
		super.update();

		if ((delay -= Game.elapsed) <= 0) {

			//pickaxe can remove the ore, should remove the sparkling too.
			if (Dungeon.level.map[pos] != Terrain.WALL_DECO){
				kill();
				return;
			}
			
			delay = Random.Float();
			
			PointF p = DungeonTilemap.tileToWorld( pos );
			((Sparkle)recycle( Sparkle.class )).reset(
				p.x + Random.Float( DungeonTilemap.SIZE ),
				p.y + Random.Float( DungeonTilemap.SIZE ) );
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:25,代码来源:CavesLevel.java


示例12: proc

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage) {
	// lvl 0 - 33%
	// lvl 1 - 50%
	// lvl 2 - 60%
	int level = Math.max( 0, weapon.level() );

	if (Random.Int( level + 3 ) >= 2) {

		Buff.affect(defender, Bleeding.class).set(damage/4);
		Splash.at( defender.sprite.center(), -PointF.PI / 2, PointF.PI / 6,
				defender.sprite.blood(), 10 );

	}

	return damage;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:18,代码来源:Vorpal.java


示例13: Camera

import com.watabou.utils.PointF; //导入依赖的package包/类
public Camera( int x, int y, int width, int height, float zoom ) {
	
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
	this.zoom = zoom;
	
	screenWidth = (int)(width * zoom);
	screenHeight = (int)(height * zoom);
	
	scroll = new PointF();
	
	matrix = new float[16];
	Matrix.setIdentity( matrix );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:17,代码来源:Camera.java


示例14: Visual

import com.watabou.utils.PointF; //导入依赖的package包/类
public Visual(float x, float y, float width, float height)
{
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;

    scale = new PointF(1, 1);
    origin = new PointF();

    matrix = new float[16];

    resetColor();

    speed = new PointF();
    acc = new PointF();
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:18,代码来源:Visual.java


示例15: update

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (phase < 1) {
		if ((phase -= Game.elapsed) <= 0) {
			killAndErase();
		} else {
			scale.set( (2 - phase) * radius / RADIUS );
			am = phase * (-1);
			aa = phase * (+1);
		}
	}
	
	if (visible = WandmakerSprite.this.visible) {
		PointF p = WandmakerSprite.this.center();
		point(p.x, p.y );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:20,代码来源:WandmakerSprite.java


示例16: reset

import com.watabou.utils.PointF; //导入依赖的package包/类
public void reset(float x, float y) {
	revive();

	this.x = x;
	this.y = y;

	left = lifespan;

	size = 4;
	speed.polar(-Random.Float(PointF.PI), Random.Float(32, 48));
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:12,代码来源:PoisonGooSprite.java


示例17: JumpTweener

import com.watabou.utils.PointF; //导入依赖的package包/类
public JumpTweener(Visual visual, PointF pos, float height, float time) {
	super(visual, time);

	this.visual = visual;
	start = visual.point();
	end = pos;

	this.height = height;
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:10,代码来源:CharSprite.java


示例18: bloodBurstA

import com.watabou.utils.PointF; //导入依赖的package包/类
@Override
public void bloodBurstA(PointF from, int damage) {
	//Does nothing.

	/*
	 * This is both for visual clarity, and also for content ratings regarding violence
	 * towards human characters. The heroes are the only human or human-like characters which
	 * participate in combat, so removing all blood associated with them is a simple way to
	 * reduce the violence rating of the game.
	 */
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:12,代码来源:HeroSprite.java


示例19: staffFx

import com.watabou.utils.PointF; //导入依赖的package包/类
public void staffFx( MagesStaff.StaffParticle particle ){
	particle.color(0xFFFFFF); particle.am = 0.3f;
	particle.setLifespan( 1f);
	particle.speed.polar( Random.Float(PointF.PI2), 2f );
	particle.setSize( 1f, 2f );
	particle.radiateXY(0.5f);
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:8,代码来源:Wand.java


示例20: Identification

import com.watabou.utils.PointF; //导入依赖的package包/类
public Identification( PointF p ) {

		for (int i=0; i < DOTS.length; i += 2) {
			add( new Speck( p.x, p.y, DOTS[i], DOTS[i+1] ) );
			add( new Speck( p.x, p.y, DOTS[i], DOTS[i+1] ) );
		}
	}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:8,代码来源:Identification.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java WildcardType类代码示例发布时间:2022-05-21
下一篇:
Java BroadcastTree类代码示例发布时间: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