Add bloodsplats
This commit is contained in:
parent
841add17c6
commit
f2c7d0910c
BIN
assets/Textures/bloodsplat1.png
Normal file
BIN
assets/Textures/bloodsplat1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 269 KiB |
@ -614,12 +614,12 @@ public class LoadingThread extends Thread {
|
|||||||
// ActorUtils.applyBlenderTransformer(building);
|
// ActorUtils.applyBlenderTransformer(building);
|
||||||
|
|
||||||
//spawn evil goblin
|
//spawn evil goblin
|
||||||
// Entity goblin = CreatureUtils.spawnBasicCreature("Goblin");
|
Entity goblin = CreatureUtils.spawnBasicCreature("Goblin");
|
||||||
// CollisionObjUtils.positionCharacter(goblin, new Vector3f(30, 0, 30));
|
CollisionObjUtils.positionCharacter(goblin, new Vector3f(4, 0, 4));
|
||||||
// EntityUtils.getScale(goblin).set(0.005f);
|
EntityUtils.getScale(goblin).set(0.005f);
|
||||||
// //give evil goblin sword
|
//give evil goblin sword
|
||||||
// Entity goblinSword = ItemUtils.spawnBasicItem("Katana");
|
Entity goblinSword = ItemUtils.spawnBasicItem("Katana");
|
||||||
// AttachUtils.attachEntityToEntityAtBone(goblin, goblinSword, "Bone.031");
|
AttachUtils.attachEntityToEntityAtBone(goblin, goblinSword, "Bone.031");
|
||||||
// //attach ai to evil goblin
|
// //attach ai to evil goblin
|
||||||
// MindlessAttacker.attachToCreature(goblin);
|
// MindlessAttacker.attachToCreature(goblin);
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,7 @@ public class HitboxUtils {
|
|||||||
LifeUtils.getLifeState(hurtboxParent).damage(20);
|
LifeUtils.getLifeState(hurtboxParent).damage(20);
|
||||||
if(currentHp > lifeState.getLifeCurrent()){
|
if(currentHp > lifeState.getLifeCurrent()){
|
||||||
Vector3d hurtboxPos = EntityUtils.getPosition(hurtbox);
|
Vector3d hurtboxPos = EntityUtils.getPosition(hurtbox);
|
||||||
ParticleEffects.spawnSparks(new Vector3f((float)hurtboxPos.x,(float)hurtboxPos.y,(float)hurtboxPos.z).add(0,0.1f,0), 20, 40);
|
ParticleEffects.spawnBloodsplats(new Vector3f((float)hurtboxPos.x,(float)hurtboxPos.y,(float)hurtboxPos.z).add(0,0.1f,0), 20, 40);
|
||||||
}
|
}
|
||||||
if(!LifeUtils.getLifeState(hurtboxParent).isIsAlive()){
|
if(!LifeUtils.getLifeState(hurtboxParent).isIsAlive()){
|
||||||
EntityUtils.getPosition(hurtboxParent).set(Globals.spawnPoint);
|
EntityUtils.getPosition(hurtboxParent).set(Globals.spawnPoint);
|
||||||
|
|||||||
@ -25,4 +25,17 @@ public class ParticleEffects {
|
|||||||
EntityUtils.getScale(spark).mul(0.03f);
|
EntityUtils.getScale(spark).mul(0.03f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void spawnBloodsplats(Vector3f position, int min, int max){
|
||||||
|
Random rand = new Random();
|
||||||
|
int num = (int)(rand.nextFloat() * (max - min)) + min;
|
||||||
|
for(int i = 0; i < num; i++){
|
||||||
|
Vector3f direction = new Vector3f(rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f,rand.nextFloat() - 0.5f).normalize();
|
||||||
|
float velocity = rand.nextFloat() * 0.001f;
|
||||||
|
float acceleration = 0.000005f;
|
||||||
|
Entity spark = ParticleUtils.spawnBillboardParticle("Textures/bloodsplat1.png", 90, direction, velocity, acceleration);
|
||||||
|
EntityUtils.getPosition(spark).set(position);
|
||||||
|
EntityUtils.getScale(spark).mul(0.1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user