本文整理汇总了Java中net.mostlyoriginal.api.component.basic.Angle类的典型用法代码示例。如果您正苦于以下问题:Java Angle类的具体用法?Java Angle怎么用?Java Angle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Angle类属于net.mostlyoriginal.api.component.basic包,在下文中一共展示了Angle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
@Override
protected void initialize() {
super.initialize();
dustParticle = new ArchetypeBuilder()
.add(Pos.class)
.add(Anim.class)
.add(Renderable.class)
.add(Schedule.class)
.add(Scale.class)
.add(Gravity.class)
.add(Physics.class).build(world);
smokeParticle = new ArchetypeBuilder()
.add(Pos.class)
.add(Anim.class)
.add(Angle.class)
.add(Renderable.class)
.add(Schedule.class)
.add(ZPos.class)
.add(Scale.class)
.add(Physics.class).build(world);
}
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:23,代码来源:SmokeSystem.java
示例2: spawn
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
public void spawn(int x, int y, String id, String color, boolean smoke, boolean spark, boolean explodes) {
assetSystem.playSfx("catapult");
new DynastyEntityBuilder(world).pos(x, y)
.with(Angle.class)
.ancient()
.gravity(0, -1f)
.velocity(MathUtils.random(-400, 400), MathUtils.random(-100, -50), 0.2f)
.tint(color)
.anim(id)
.renderable(800)
.scale(G.ZOOM)
.z(MathUtils.random(0, 48))
.fireball(smoke, spark, explodes)
.build();
}
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:17,代码来源:FireballSystem.java
示例3: spawnPointer
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private void spawnPointer(int x, int y, int angle, Ingredient.Type type, boolean inverted) {
int i =angle+90;
vector2 = v2.set(0, -G.TILE_SIZE - 3).setAngle(i);
new EntityBuilder(world).with(
new Pos(x + 3 + vector2.x, y + 6 + vector2.y),
new Angle(i-90+(inverted?-180:0), 7, 5),
new Anim("pointer"),
new Color(1f,1f,1f,0.6f),
new Renderable(LAYER_CONVEYER + 1)
).build();
// for (i =0; i>-360; i--) {
vector2 = v2.set(-15, -G.TILE_SIZE + 4).setAngle(i);
final String id = "ingredient-" + type.name();
final Animation animation = abstractAssetSystem.get(id);
final TextureRegion region = animation.getKeyFrames()[0];
new EntityBuilder(world).with(
new Pos(x + vector2.x + 10 - region.getRegionWidth()/2, y + 10 + vector2.y - region.getRegionHeight()/2),
new Color(1f, 1f, 1f, 0.8f),
new Anim(id),
new Renderable(LAYER_CONVEYER + 2)
).build();
//}
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:27,代码来源:GameScreenSetupSystem.java
示例4: createDraggingIndicator
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private void createDraggingIndicator(Entity draggable) {
final Anim sourceAnim = mAnim.get(draggable);
final Pos sourcePos = mPos.get(draggable);
final Bounds sourceBounds = mBounds.get(draggable);
final Anim anim = new Anim();
anim.id = sourceAnim.id;
anim.speed = sourceAnim.speed;
anim.age = sourceAnim.age;
final Pos pos = new Pos();
pos.x = sourcePos.x;
pos.y = sourcePos.y;
NO_ANGLE = new Angle(0);
new EntityBuilder(world)
.with(new Dragging(draggable), new Renderable(GameScreenSetupSystem.LAYER_DRAGGING),
new Bounds(sourceBounds.minx, sourceBounds.miny, sourceBounds.maxx, sourceBounds.maxy),
anim, pos, new Angle(mAngle.getSafe(draggable, NO_ANGLE).rotation), new Color(1f, 1f, 1f, 0.5f)
).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:23,代码来源:DragStartSystem.java
示例5: createJumpingImp
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createJumpingImp(int cx, int cy) {
Physics phys = new Physics();
phys.vx = MathUtils.random(25f,80f) * 3f;
if ( MathUtils.randomBoolean() ) phys.vx = -phys.vx;
phys.vy = MathUtils.random(100f,120f) * 3f;
phys.vr = MathUtils.random(-90,90);
phys.friction = 1f;
return world.createEntity()
.edit()
.add(new Pos(cx, cy))
.add(new Bounds(10, 10))
.add(new Angle())
.add(new Gravity())
.add(new ColorAnimation(new Color(1, 1, 1, 1), new Color(1, 1, 1, 0), Interpolation.linear, 1f, 1f))
.add(new Schedule().wait(1f).deleteFromWorld())
.add(phys)
.add(new Anim("marker-monster", 9)).getEntity();
}
开发者ID:DaanVanYperen,项目名称:underkeep,代码行数:21,代码来源:EntityFactorySystem.java
示例6: createParticleDebris
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createParticleDebris(int cx, int cy) {
Physics phys = new Physics();
phys.vx = MathUtils.random(25f,80f) * 3f;
if ( MathUtils.randomBoolean() ) phys.vx = -phys.vx;
phys.vy = MathUtils.random(100f,120f) * 2f;
phys.vr = MathUtils.random(-90,90);
phys.friction = 3f;
Anim anim = staticRandomizedAnim("particle-debris");
anim.layer=9;
return world.createEntity()
.edit()
.add(new Pos(cx, cy))
.add(new Bounds(6, 5))
.add(new Angle())
.add(new Gravity())
.add(new Schedule()
.wait(MathUtils.random(0.1f, 0.25f))
.add(new ColorAnimation(new Color(1, 1, 1, 1), new Color(1, 1, 1, 0), Interpolation.linear, 0.5f, 0.5f))
.wait(1f)
.deleteFromWorld())
.add(phys)
.add(anim).getEntity();
}
开发者ID:DaanVanYperen,项目名称:underkeep,代码行数:26,代码来源:EntityFactorySystem.java
示例7: createParticleCoin
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createParticleCoin(int cx, int cy) {
Physics phys = new Physics();
phys.vx = MathUtils.random(25f,80f) * 3f;
if ( MathUtils.randomBoolean() ) phys.vx = -phys.vx;
phys.vy = MathUtils.random(100f,120f) * 2f;
phys.vr = MathUtils.random(-90,90);
phys.friction = 3f;
Anim anim = staticRandomizedAnim("particle-coin");
anim.layer=200;
return world.createEntity().edit()
.add(new Pos(cx, cy))
.add(new Bounds(6,5))
.add(new Angle())
.add(new Gravity())
.add(new Schedule()
.wait(MathUtils.random(0.1f, 0.25f))
.add(new ColorAnimation(new Color(1, 1, 1, 1), new Color(1, 1, 1, 0), Interpolation.linear, 0.5f, 0.5f))
.wait(1f)
.deleteFromWorld())
.add(phys)
.add(anim).getEntity();
}
开发者ID:DaanVanYperen,项目名称:underkeep,代码行数:25,代码来源:EntityFactorySystem.java
示例8: process
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
protected void process(final int e) {
final Anim anim = mAnim.get(e);
final Pos pos = mPos.get(e);
final Angle angle = mAngle.getSafe(e, Angle.NONE);
final float scale = mScale.getSafe(e, Scale.DEFAULT).scale;
final Origin origin = mOrigin.getSafe(e, DEFAULT_ORIGIN);
batch.setColor(mTint.getSafe(e, Tint.WHITE).color);
if ( anim.id != null ) drawAnimation(anim, angle, origin, pos, anim.id,scale);
if ( anim.id2 != null ) drawAnimation(anim, angle,origin, pos, anim.id2,scale);
anim.age += world.delta * anim.speed;
}
开发者ID:DaanVanYperen,项目名称:odb-artax,代码行数:16,代码来源:MyAnimRenderSystem.java
示例9: process
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
protected void process(final int e) {
final Anim anim = mAnim.get(e);
final Pos pos = mPos.get(e);
final Angle angle = mAngle.getSafe(e, Angle.NONE);
final float scale = mScale.getSafe(e, Scale.DEFAULT).scale;
final Origin origin = mOrigin.getSafe(e, DEFAULT_ORIGIN);
anim.age += world.delta * anim.speed;
batch.setColor(mTint.getSafe(e, Tint.WHITE).color);
if ( anim.id != null ) drawAnimation(anim, angle, origin, pos, anim.id,scale);
if ( anim.id2 != null ) drawAnimation(anim, angle,origin, pos, anim.id2,scale);
}
开发者ID:DaanVanYperen,项目名称:odb-little-fortune-planet,代码行数:16,代码来源:MyAnimRenderSystem.java
示例10: smoke
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
public void smoke(float x, float y, float distance, int particles, int zPosLayer, int zPosLayerOffset, String[] ids, float minSize, float maxSize, float rotMin, float rotMax, boolean gravity, float vxMin, float vxMax, float vyMin, float vyMax, float duration) {
for(int i = 0; i<particles; i++) {
float size = MathUtils.random(minSize, maxSize);
int rotation = MathUtils.random(0, 360);
tmp.set(0, MathUtils.random(0,distance)).rotateRad(rotation);
int e = world.create(smokeParticle);
mPos.get(e).set(x+tmp.x - size/2,y+tmp.y - size/2);
mAnim.get(e).id= ids[MathUtils.random(0, ids.length-1)];
Physics physics = mPhysics.get(e);
physics.vx=MathUtils.random(vxMin, vxMax);
physics.vy=5 + MathUtils.random(vyMin, vyMax);
physics.vr= MathUtils.random(rotMin, rotMax);
if (gravity) {
Gravity gravity1 = mGravity.create(e);
gravity1.y=-1f;
}
physics.friction=0f;
ZPos zPos = mZPos.get(e);
zPos.z = zPosLayer;
zPos.layerOffset = zPosLayerOffset;
Angle angle = mAngle.get(e);
angle.ox = (int) (size/2f * G.ZOOM);
angle.oy = (int) (size/2f * G.ZOOM);
angle.rotation = rotation;
mScale.get(e).scale= size;
mSchedule.get(e).operation.add(
OperationFactory.sequence(
OperationFactory.tween(start, stop, duration),
OperationFactory.deleteFromWorld()));
}
}
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:36,代码来源:SmokeSystem.java
示例11: spawnHammer
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private void spawnHammer(int e, float delayTime) {
Pos pos = mPos.get(e);
Entity entity = new DynastyEntityBuilder(world)
.with(Hammer.class)
.pos(pos.xy.x, pos.xy.y + 8 * G.ZOOM)
.renderable(9000)
.anim("GO-HAMMER")
.scale(G.ZOOM)
.tint("FFFFFF00")
.schedule(
sequence(
delay(delayTime),
tween( new Tint("FFFFFF00"), new Tint("FFFFFFFF"), 0.1f),
tween(
new Pos(pos.xy.x, pos.xy.y + 8 * G.ZOOM),
new Pos(G.CANVAS_WIDTH / 2, 10 * G.ZOOM), 2f, Interpolation.pow2In),
deleteFromWorld()
))
.build();
Angle angle = mAngle.create(entity);
angle.ox = AssetSystem.HAMMER_WIDTH / 2 * G.ZOOM;
angle.oy = AssetSystem.HAMMER_HEIGHT / 2 * G.ZOOM;
Physics physics = mPhysics.create(entity);
physics.friction=0;
physics.vr = 400;
}
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:29,代码来源:MinionSystem.java
示例12: process
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
@Override
protected void process(int e) {
Physics physics = mPhysics.get(e);
Pos pos = mPos.get(e);
Angle angle = mAngle.get(e);
angle.ox = AssetSystem.FIREBALL_WIDTH / 2;
angle.oy = AssetSystem.FIREBALL_HEIGHT / 2;
angle.rotation =
v2.set(physics.vx, physics.vy).angle() + 90;
Fireball fireball = mFireball.get(e);
fireball.smokeCooldown -= world.delta;
fireball.sparkCooldown -= world.delta;
ZPos zPos = mZPos.get(e);
if (fireball.smokeCooldown <= 0 && fireball.hasSmoke) {
v2.rotateRad(90).nor().scl(20);
fireball.smokeCooldown += 0.1f;
smokeSystem.smoke(pos.xy.x + v2.x, pos.xy.y + v2.y, 4, 3, (int) zPos.z, zPos.layerOffset - 1, SMOKE_PARTICLE_IDS, 1f, 5f, -1, 1, false, 2f, 2f, 2f, 2f, 6f);
}
if (fireball.sparkCooldown <= 0 && fireball.hasSparks) {
fireball.sparkCooldown += 0.05f;
smokeSystem.smoke(pos.xy.x + v2.x, pos.xy.y + v2.y, 4, 3, (int) zPos.z, zPos.layerOffset - 1, FIRE_PARTICLE_IDS, 1f, 3f, -180f, 180f, true, 2f, 2f, 2f, 2f, 2f);
}
clampToBorders(e);
if (zPos.height <= 5) {
crashMaybeExplode(e);
}
}
开发者ID:DaanVanYperen,项目名称:odb-dynasty,代码行数:33,代码来源:FireballSystem.java
示例13: initialize
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
@Override
protected void initialize() {
Anim refresh = new Anim("refresh");
refresh.scale = 5;
refreshIndicator = new EntityBuilder(world).with(new Pos(0, G.CANVAS_HEIGHT-120), new Color(1f,1f,1f,0.5f), new Angle(0,40,40), refresh, new Renderable(4000)).build();
setPrerequisiteSystems(preferredRouteCalculationSystem);
}
开发者ID:DaanVanYperen,项目名称:ns2-scc-profiler,代码行数:8,代码来源:RefreshHandlerSystem.java
示例14: processEntities
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
@Override
protected void processEntities(ImmutableBag<Entity> entities) {
Angle angle = mAngle.get(refreshIndicator);
angle.rotation += world.delta * -400f;
super.processEntities(entities);
if ( restartAfterCooldown > 0 )
{
restartAfterCooldown -= world.delta;
if ( restartAfterCooldown <= 0 )
{
restart();
}
}
}
开发者ID:DaanVanYperen,项目名称:ns2-scc-profiler,代码行数:16,代码来源:RefreshHandlerSystem.java
示例15: createDispenser
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createDispenser(int x, int y, int angle, Ingredient.Type type) {
spawnPointer(x, y, angle, type, false);
return new EntityBuilder(world).with(
new Pos(x, y),
new Bounds(2, 2, 18, 18),
new Conveyer(90f),
new Angle(angle),
new Dispenser(type)).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:12,代码来源:GameScreenSetupSystem.java
示例16: createBeltStraight
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createBeltStraight(int x, int y, int angle) {
return new EntityBuilder(world).with(
new Pos(x, y),
new Bounds(2, 2, 18, 18),
new Anim("belt-straight"),
new Renderable(1000),
new Angle(angle),
new Conveyer(90f)).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:10,代码来源:GameScreenSetupSystem.java
示例17: createBeltBend
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createBeltBend(int x, int y, int angle) {
return new EntityBuilder(world).with(
new Pos(x, y),
new Bounds(2, 2, 18, 18),
new Anim("belt-bend"),
new Renderable(LAYER_CONVEYER),
new Angle(angle),
new Conveyer(45)).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:10,代码来源:GameScreenSetupSystem.java
示例18: createBeltBendInverse
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createBeltBendInverse(int x, int y, int angle) {
return new EntityBuilder(world).with(
new Pos(x, y),
new Bounds(2, 2, 18, 18),
new Anim("belt-bend-inverse"),
new Renderable(LAYER_CONVEYER),
new Angle(angle),
new Conveyer(45 + 180)).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:10,代码来源:GameScreenSetupSystem.java
示例19: createCrusherY
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createCrusherY(int x, int y) {
return new EntityBuilder(world).with(
new Pos(x, y + 1),
new Bounds(5, 0, 15, 20),
new Anim("factory-crusher"),
new Renderable(LAYER_FACTORIES),
new Angle(0f),
new Crusher()).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:10,代码来源:GameScreenSetupSystem.java
示例20: createShowerY
import net.mostlyoriginal.api.component.basic.Angle; //导入依赖的package包/类
private Entity createShowerY(int x, int y) {
return new EntityBuilder(world).with(
new Pos(x, y),
new Bounds(0, 0, 20, 20),
new Anim("factory-shower"),
new Renderable(LAYER_FACTORIES),
new Angle(0f),
new Shower()).build();
}
开发者ID:DaanVanYperen,项目名称:odb-minion-factorium,代码行数:10,代码来源:GameScreenSetupSystem.java
注:本文中的net.mostlyoriginal.api.component.basic.Angle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论