本文整理汇总了Java中org.newdawn.slick.particles.ConfigurableEmitter.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableEmitter.setEnabled方法的具体用法?Java ConfigurableEmitter.setEnabled怎么用?Java ConfigurableEmitter.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.particles.ConfigurableEmitter
的用法示例。
在下文中一共展示了ConfigurableEmitter.setEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.newdawn.slick.particles.ConfigurableEmitter; //导入方法依赖的package包/类
@Override
public void init(GameContainer arg0, StateBasedGame arg1) throws SlickException {
player = new Player();
buildings = new ArrayList<>();
goons = new ArrayList<>();
bullets = new ArrayList<>();
playerImage = new Image("res/player.png");
playerImage.setFilter(Image.FILTER_NEAREST);
playerJump = new Image("res/playerjump.png");
playerJump.setFilter(Image.FILTER_NEAREST);
cannonImage = new Image("res/cannon.png");
cannonImage.setFilter(Image.FILTER_LINEAR);
cannonImage.setCenterOfRotation(Player.CANNON_CENTER_X, Player.CANNON_CENTER_Y);
SpriteSheet playerSS = new SpriteSheet("res/player_run.png", 60, 75);
playerRunRight = new Animation(playerSS, RUN_ANIMATION_SPEED);
playerRunLeft = new Animation();
int ssw = playerSS.getHorizontalCount(), ssh = playerSS.getVerticalCount();
for (int y = 0; y < ssh; y++) {
for (int x = 0; x < ssw; x++) {
playerRunLeft.addFrame(playerSS.getSprite(x, y).getFlippedCopy(true, false), RUN_ANIMATION_SPEED);
}
}
bulletAnim = new Animation(new SpriteSheet("res/bullet.png", 30, 30), BULLET_ANIMATION_SPEED);
buildingTexture = new Image("res/building.png");
buildingLastRow = buildingTexture.getSubImage(0, buildingTexture.getHeight() - 1, buildingTexture.getWidth(), 1);
buildingTexture.setFilter(Image.FILTER_NEAREST);
buildingLastRow.setFilter(Image.FILTER_NEAREST);
graffitiImages = new Image[NUM_GRAFFITI * 2];
for (int i = 0; i < NUM_GRAFFITI; i++) {
graffitiImages[i] = new Image("res/graffiti" + i + ".png");
graffitiImages[i + NUM_GRAFFITI] = graffitiImages[i].getFlippedCopy(true, false);
}
graffiti = new ArrayList<>();
mainTheme = new Music("res/main.ogg");
try {
partsys = ParticleIO.loadConfiguredSystem("res/particle.xml");
} catch (IOException e) {
e.printStackTrace();
}
fireExplosion = (ConfigurableEmitter)partsys.getEmitter(0);
blueExplosion = (ConfigurableEmitter)partsys.getEmitter(1);
fireExplosion.setEnabled(false);
blueExplosion.setEnabled(false);
fireCannon = new Sound("res/firecannon.ogg");
highExplosion = new Sound("res/highexplosion.ogg");
softExplosion = new Sound("res/softexplosion.ogg");
hurtSound = new Sound("res/hurt.ogg");
basicGoon = new Image("res/plasticbag.png");
strongGoon = new Image("res/trashbag.png");
flyingGoon = new Animation(new SpriteSheet("res/tshirt.png", 50, 50), 200);
background = new Image("res/sunset.png");
background.setFilter(Image.FILTER_NEAREST);
camx = 0;
camy = 0;
camvx = 0;
}
示例2: createFireExplosion
import org.newdawn.slick.particles.ConfigurableEmitter; //导入方法依赖的package包/类
private void createFireExplosion(float x, float y) {
ConfigurableEmitter e = fireExplosion.duplicate();
e.setEnabled(true);
e.setPosition(x, y, false);
partsys.addEmitter(e);
}
示例3: createBlueExplosion
import org.newdawn.slick.particles.ConfigurableEmitter; //导入方法依赖的package包/类
private void createBlueExplosion(float x, float y) {
ConfigurableEmitter e = blueExplosion.duplicate();
e.setEnabled(true);
e.setPosition(x, y, false);
partsys.addEmitter(e);
}