铁锈战争模组和地图制作帮助文档

效果系统

在铁锈战争中,效果系统用于创建视觉和听觉效果,增强游戏体验。本章节将详细介绍如何配置各种效果,包括爆炸效果、死亡效果、动作效果等。

效果基本配置

效果系统通过不同的部分来定义,主要包括[deathSpawn]、[effect_#]等:

[deathSpawn] 死亡效果

[deathSpawn]
spawnEffects:customExplosion
            

死亡效果属性说明

属性 说明 示例
spawnEffects 生成效果 spawnEffects:customExplosion

爆炸效果设置

可以配置单位死亡时的爆炸效果:

爆炸效果属性

[core]
explodeOnDeath:true
deathExplosion:largeExplosion
deathExplosionPower:100
            

爆炸效果属性说明

属性 说明 示例
explodeOnDeath 死亡时爆炸 explodeOnDeath:true
deathExplosion 死亡爆炸效果 deathExplosion:largeExplosion
deathExplosionPower 死亡爆炸威力 deathExplosionPower:100

效果定义

可以通过[effect_#]部分定义自定义效果:

[effect_#] 效果设置

[effect_1]
life:60
image:effects/explosion.png
total_frames:12
color:#FF4500
scaleFrom:1
scaleTo:3
            

效果属性说明

属性 说明 示例
life 效果持续时间 life:60
image 效果图像 image:effects/explosion.png
total_frames 总帧数 total_frames:12
color 颜色 color:#FF4500
scaleFrom 起始缩放 scaleFrom:1
scaleTo 结束缩放 scaleTo:3

效果动画设置

可以配置效果的动画参数:

动画属性

[effect_1]
fadeIn:true
fadeOut:true
alpha:1
delayedStart:10
            

动画属性说明

属性 说明 示例
fadeIn 淡入效果 fadeIn:true
fadeOut 淡出效果 fadeOut:true
alpha 透明度 alpha:1
delayedStart 延迟开始 delayedStart:10

效果运动设置

可以配置效果的运动参数:

运动属性

[effect_1]
xSpeed:0
ySpeed:-1
xSpeedRelative:0.5
ySpeedRelative:0.5
            

运动属性说明

属性 说明 示例
xSpeed X轴速度 xSpeed:0
ySpeed Y轴速度 ySpeed:-1
xSpeedRelative 相对X轴速度 xSpeedRelative:0.5
ySpeedRelative 相对Y轴速度 ySpeedRelative:0.5

效果声音设置

可以为效果添加声音:

声音属性

[effect_1]
soundEnabled:true
soundToPlay:explosion_sound
            

声音属性说明

属性 说明 示例
soundEnabled 启用声音 soundEnabled:true
soundToPlay 播放声音 soundToPlay:explosion_sound

效果光照设置

可以为效果添加光照:

光照属性

[effect_1]
lightSize:2
lightColor:#FF4500
            

光照属性说明

属性 说明 示例
lightSize 光照大小 lightSize:2
lightColor 光照颜色 lightColor:#FF4500

效果粒子系统

可以配置粒子效果:

粒子属性

[effect_1]
createWhenOverLiquid:false
createWhenOverLand:true
createWhenZeroHp:false
            

粒子属性说明

属性 说明 示例
createWhenOverLiquid 在液体上创建 createWhenOverLiquid:false
createWhenOverLand 在陆地上创建 createWhenOverLand:true
createWhenZeroHp 在零血量时创建 createWhenZeroHp:false

效果混合模式

可以设置效果的混合模式:

混合模式属性

[effect_1]
drawUnderUnits:true
alsoPlaySound:true
            

混合模式属性说明

属性 说明 示例
drawUnderUnits 在单位下方绘制 drawUnderUnits:true
alsoPlaySound 同时播放声音 alsoPlaySound:true

完整效果示例

爆炸效果

[effect_1]
life:60
image:effects/explosion.png
total_frames:12
color:#FF4500
scaleFrom:1
scaleTo:3
fadeIn:true
fadeOut:true
alpha:1
xSpeed:0
ySpeed:-1
lightSize:2
lightColor:#FF4500
soundEnabled:true
soundToPlay:explosion_sound

[effect_2]
life:30
image:effects/smoke.png
total_frames:8
color:#808080
scaleFrom:0.5
scaleTo:2
fadeIn:true
fadeOut:true
alpha:0.7
xSpeed:0
ySpeed:-0.5
            

死亡效果

[deathSpawn]
spawnEffects:deathExplosion

[effect_deathExplosion]
life:45
image:effects/large_explosion.png
total_frames:16
color:#FF0000
scaleFrom:2
scaleTo:5
fadeIn:true
fadeOut:true
alpha:1
lightSize:3
lightColor:#FF0000
soundEnabled:true
soundToPlay:large_explosion_sound
            

移动效果

[movement]
dustEffect:true
splastEffect:true

[effect_dust]
life:20
image:effects/dust.png
total_frames:6
color:#C0C0C0
scaleFrom:0.3
scaleTo:1
fadeIn:true
fadeOut:true
alpha:0.5
xSpeedRelative:0.2
ySpeedRelative:0.2

[effect_splash]
life:15
image:effects/splash.png
total_frames:5
color:#0000FF
scaleFrom:0.5
scaleTo:1.5
fadeIn:true
fadeOut:true
alpha:0.8
            

注意事项

回到顶部