Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,435 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Collision detection?? #174541
12/23/07 12:13
12/23/07 12:13
Joined: Jan 2005
Posts: 267
the Netherlands
Paulo Offline OP
Member
Paulo  Offline OP
Member

Joined: Jan 2005
Posts: 267
the Netherlands
Hi,

What I like to get accomplished is a super mario like style in "killing" enemies. When my player jumps ontop of an enemy's head the enemie should die. The dying part of an enemy is no problem BUT, how do I make my code so that when my player jumps ontop of an enemy's head the enemy dies. And when the player hits some other part then the top of the head of the enemy, the player dies or gets hurt or something like that.

Whats the best thing to use in this situation, something with vec_for_vertex ???
I dont know.

Thanks


The more you have.. the more you can lose...
Dont tell em all you know.....
Re: Collision detection?? [Re: Paulo] #174542
12/23/07 12:19
12/23/07 12:19
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Best thing:
use the events event_impact and event_entity of the enemy and check the z value of the you entity:
Code:

function enemy_event()
{
if(event_type == event_impact || event_type == event_entity)
{
if(you == player)
{
if(you.z > my.z) { my.health = 0; }
else { you.health -= my.damage; }
}
}
}

action enemy_act
{
my.enable_impact = on;
my.enable_entity = on;
my.event = enemy_event;

my.health = 100;
my.damage = 5;

while(my.health > 0)
{
// do whatever
}

//Die part:
wait(1);
ent_remove(me);
}



Re: Collision detection?? [Re: Xarthor] #174543
12/23/07 12:22
12/23/07 12:22
Joined: Jan 2005
Posts: 267
the Netherlands
Paulo Offline OP
Member
Paulo  Offline OP
Member

Joined: Jan 2005
Posts: 267
the Netherlands
Great !! Thank you ver much Xarthor for your quick response.


The more you have.. the more you can lose...
Dont tell em all you know.....

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1