Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, degenerate_762, AndrewAMD, ozgur), 774 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: [ANet] enemy [Re: MasterQ32] #408394
09/30/12 15:32
09/30/12 15:32
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Code:
you=players[enet_ent_creator(enet_ent_globpointer(players[cl_id]))];



I assume that players[] is an array where the local pointer of each player is stored. The index is the client id of the player.

If my assumption is correct, it should be like this (code snippet running in the enemies function):

Code:
// get the pointer to the player
you = players[enet_get_clientid()];
// calc distance between enemy and player
distance = vec_dist(you.x, my.x);



ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] enemy [Re: Dark_samurai] #408407
09/30/12 17:36
09/30/12 17:36
Joined: Sep 2012
Posts: 21
France
larafale Offline OP
Newbie
larafale  Offline OP
Newbie

Joined: Sep 2012
Posts: 21
France
Thanks a lot, it works fine into the real enemy function.

Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | 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