Posted By: Spkka
Collision with entity, platform or enemy? - 12/01/09 16:36
Hey, I got a problem while checking player collision with enemy entities. I also got moving platforms etc which are also entities.
I know I can use EVENT_ENTITY, but how can I figure out wether or not the entity is an enemy? The entities are placed in the WED, so not created with ent_create.
Thanks in advance
Posted By: Widi
Re: Collision with entity, platform or enemy? - 12/01/09 17:57
Use a skill for that. For example: enemys.skill70 = 1, Platforms = 2, Items = 3 and so on. Now in your event you can read the you.skill70 from the Entity that make the collision with your Player. You can use the following code:
if(!you) {return;} // collision with blocks...
switch(you.skill70)
{
case 1: collision_enemy_func(); break;
case 2: collision_platform_func(); break;
case 3: collision_item_func(); break;
}
Posted By: EvilSOB
Re: Collision with entity, platform or enemy? - 12/01/09 21:21
Widi's idea is good but you may choose to use a skill number
a lot less than 70.
It may he helpfult to remind/inform you that only skills 1 through to 20
are available through WED.
So if you choose a skill below 21, you can SET your "enemy-type" skill
stright from inside WED, without mucking about in script.