Hello Antheor!
I’m using physics particles in my game and you can use custom properties for those at least.
You could do something like this:
Particles.CreateParticleType ("MyLaserParticle",
{
imagePath = "assets/particles/redlaser.png",
imageWidth = 8,
imageHeight = 15,
velocityStart = 600,
autoOrientation = true,
killOutsideScreen = false,
lifeTime = 3000,
alphaStart = 0.8,
blendMode = "add",
colorStart = {255, 0, 0},
-- APPLY PHYSICS:
PhysicsMaterial = { density = 0, friction = 0, bounce = 0 },
PhysicsProperties = {
filter = {},
isFixedRotation = true,
isSleepingAllowed = false,
bodyType = "dynamic",
isSensor = true,
ID = object.ammoID, -- ID for the ammo (for example "playerAmmo")
damage = object.damage, -- custom property: damage for the particle type
dieOnImpact = true, -- custom property: destroy particle on impact
gravityScale = 0
}
} )
local Particle = nil
-- check who's particle this is
if event.object1.ID == "playerAmmo" then Particle = event.object1; end;
if event.object2.ID == "playerAmmo" then Particle = event.object2; end;
-- check if player's particle hits the enemy...
-- reduce enemy health
enemy.health = enemy.health - Particle.damage -- here we use custom property "damage"
Hope this helps!
Br,
Kalle [import]uid: 55867 topic_id: 33808 reply_id: 136314[/import]