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

Java ParticleSystem类代码示例

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

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



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

示例1: update

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.particles.ParticleEmitter#update(org.newdawn.slick.particles.ParticleSystem, int)
 */
public void update(ParticleSystem system, int delta) {
	timer -= delta;
	if (timer <= 0) {
		timer = interval;
		Particle p = system.getNewParticle(this, 1000);
		p.setColor(1, 1, 1, 0.5f);
		p.setPosition(x, y);
		p.setSize(size);
		float vx = (float) (-0.02f + (Math.random() * 0.04f));
		float vy = (float) (-(Math.random() * 0.15f));
		p.setVelocity(vx,vy,1.1f);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:17,代码来源:FireEmitter.java


示例2: init

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
	Image image = new Image("testdata/particle.tga", true);
	system = new ParticleSystem(image);
	
	system.addEmitter(new FireEmitter(400,300,45));
	system.addEmitter(new FireEmitter(200,300,60));
	system.addEmitter(new FireEmitter(600,300,30));
	
	//system.setUsePoints(true);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:14,代码来源:ParticleTest.java


示例3: keyPressed

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#keyPressed(int, char)
 */
public void keyPressed(int key, char c) {
	if (key == Input.KEY_ESCAPE) {
		System.exit(0);
	}
	if (key == Input.KEY_SPACE) {
		mode = ParticleSystem.BLEND_ADDITIVE == mode ? ParticleSystem.BLEND_COMBINE : ParticleSystem.BLEND_ADDITIVE;
		system.setBlendingMode(mode);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:13,代码来源:ParticleTest.java


示例4: clearSystem

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * Clear the particle system held in this canvas
 * 
 * @param additive
 *            True if the particle system should be set to additive
 */
public void clearSystem(boolean additive) {
	system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
	if (additive) {
		system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
	}
	system.setRemoveCompletedEmitters(false);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:14,代码来源:ParticleGame.java


示例5: setSystem

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * Set the particle system to be displayed
 * 
 * @param system
 *            The system to be displayed
 */
public void setSystem(ParticleSystem system) {
	this.system = system;
	emitters.clear();
	system.setRemoveCompletedEmitters(false);
	for (int i = 0; i < system.getEmitterCount(); i++) {
		emitters.add(system.getEmitter(i));
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:15,代码来源:ParticleGame.java


示例6: init

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
public void init(GameContainer container) throws SlickException {
	container.getInput().addListener(listener);
	container.setShowFPS(false);
	
	system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
	system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
	system.setRemoveCompletedEmitters(false);

	for (int i = 0; i < waiting.size(); i++) {
		system.addEmitter((ParticleEmitter) waiting.get(i));
	}
	waiting.clear();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:14,代码来源:ParticleGame.java


示例7: updateBlendMode

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * Change the visual indicator for the current particle system 
 * blend mode
 */
public void updateBlendMode() {
	if (additive.isSelected()) {
		game.getSystem().setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
		} else {
		game.getSystem().setBlendingMode(ParticleSystem.BLEND_COMBINE);
		}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:12,代码来源:ParticleEditor.java


示例8: init

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
public void init(GameContainer container, StateBasedGame game)
        throws SlickException {
    mGame = game;
    Image image = new Image("res/effects/particle.tga", true);
    mParticleSystem = new ParticleSystem(image);
    mBd1 = (Image)DatasManager.getInstance().getFile("Image.menubackground");
    mBd2 = (Image)DatasManager.getInstance().getFile("Image.menuplanet");
    mParticleSystem.addEmitter(new FireEmitter(500, 400, 580));
}
 
开发者ID:AlexMog,项目名称:MMO-Rulemasters-World,代码行数:10,代码来源:BackgroundPlanetScene.java


示例9: usePoints

import org.newdawn.slick.particles.ParticleSystem; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.particles.ParticleEmitter#usePoints(org.newdawn.slick.particles.ParticleSystem)
 */
public boolean usePoints(ParticleSystem system) {
	return false;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:7,代码来源:FireEmitter.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SetPermissionsOp类代码示例发布时间:2022-05-22
下一篇:
Java CronType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap