Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Shot entity with different properties hitting another entity
  • Hi folks,

    still working on my tower defense game. Right know I'm thinking about shots fired from turrets and how I can give them different properties (like damage value, armor penetration, additional poison damage...). Easiest way would be to do an entity for every kind of shot there is, each with a unique collision type and the target entities would have a rule for every possible collision. But that wouldn't be very efficient (though I'm not sure about any noticeable effect on performance).

    Making a shot entity dynamic in the sense of speed, graphics and other properties like a damage value in its own properties is relatively easy with the "copy data" option on the "spawn entity" action. But how to apply these damage values to certain entities hit? Any ideas?

    I would recommend an "implant data in hit entity on collision" action, but I don't know how hard it would be to implement something like that. Maybe there is an easier way to do it, that already exists?
  • 1 Comment sorted by
  • @Cavaron what would make this easier would be to have access to the collision data when a collision happens so you have a reference to the object you collided with. It would most likely be a property called Game.CollisionData.collidedWithEntity

    let me see if this can be added fairly easily.

    However you could try this in the meantime. Add the various projectile Properties to separate Data Container components on the canon or on a separate object that doesn't get replicated. Then setup different projectile object types in the engine. So you can have different rules on the enemy that check if collided with Missile then access the properties on the Canon.MissileProperties.damage. If it collided with a bomb then access the properties for the bomb like Canon.BombProperties.damage. Does that make sense?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion