本文整理匯總了Java中com.badlogic.gdx.math.Vector2.Zero方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector2.Zero方法的具體用法?Java Vector2.Zero怎麽用?Java Vector2.Zero使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.math.Vector2
的用法示例。
在下文中一共展示了Vector2.Zero方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Create
import com.badlogic.gdx.math.Vector2; //導入方法依賴的package包/類
public static void Create(Vector2 position, int type, Vector2 v, Vector2 vChange, float rotation, float rChange,
float scale) {
Entity entity = Entity.Create();
entity.AddComponent(new Transform(position));
Bombs bullet1 = new Bombs();
bullet1.mType = type;
bullet1.mRotation = rotation;
bullet1.mRotation2 = rChange;
bullet1.mScale = scale;
bullet1.mTempTargetVelocity = v == null ? new Vector2(0, 27) : v;
bullet1.mTempTargetVelocity2 = vChange == null ? Vector2.Zero : vChange;
switch (type) {
case TypeReimuAFast:
bullet1.mDamage = 1;
entity.AddComponent(new ImageRenderer(ResourceManager.barrages.get(type), 0));
break;
case TypeReimuASlow:
bullet1.mDamage = 1;
entity.AddComponent(new ImageRenderer(ResourceManager.barrages.get(type), 0));
break;
case TypeReimuBFast:
entity.AddComponent(
new ImageRenderer(ResourceManager.barrages.get(type), 0, 256, (int) FightScreen.TOP * 2));
break;
case TypeReimuBSlow:
entity.AddComponent(new ImageRenderer(ResourceManager.barrages.get(type), 0, 300, 300));
break;
}
entity.AddComponent(bullet1);
}
示例2: getNearestEnemy
import com.badlogic.gdx.math.Vector2; //導入方法依賴的package包/類
public Vector2 getNearestEnemy() {
// return Vector2.Zero;
return ex < 300 ? new Vector2(ex += 10, ey) : Vector2.Zero;
}