当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurableEmitter.setEnabled方法代码示例

本文整理汇总了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;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:57,代码来源:Game.java

示例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);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:7,代码来源:Game.java

示例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);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:7,代码来源:Game.java


注:本文中的org.newdawn.slick.particles.ConfigurableEmitter.setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。