Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help again #306228
01/20/10 16:00
01/20/10 16:00
Joined: Dec 2009
Posts: 24
DirtyDhan Offline OP
Newbie
DirtyDhan  Offline OP
Newbie

Joined: Dec 2009
Posts: 24
ok, so now the enemy detects the player and walks towards it. the problem is it wont stop walking cause the loop wont break because it doesnt implement the statement in
================================================
if(dist == 0)
================================================

here are the codes

================================================

action player_cb()
{
ENTITY* enemy = NULL;
//ENEMY IS STANDING ON GROUND=================================================================
VECTOR vFeet;
vec_for_min(vFeet,me);
set(my,FLAG2);
my.STATE = 1;
while(1)
{
//ENEMY IS IDLE===============================================================================
if(my.STATE == 1)
{
//DETECT THE ENEMY============================================================================
c_scan(my.x,my.pan,vector(900,0,900),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
my.ANIMATION += 10 * time_step;
ent_animate(my, "idle", my.ANIMATION, ANM_CYCLE);
if(you)
{
my.ANIMATION = 0;
my.STATE = 2;
enemy = your.PLAYER;
}
}
//PERFORM WALK ANIMATION======================================================================
if(my.STATE == 2)
{
var dist = vec_dist(my.x, your.x);

while(1)
{
if(dist != 0)
{
var distance =-5*time_step;
c_move(me, vector(0,distance,0), NULL, GLIDE);
walk_percentage += 2* distance;
ent_animate(my,"walk",walk_percentage,ANM_CYCLE);

if(dist == 0)
{
my.ANIMATION = 0;
my.STATE = 1;
}
}
wait(1);
}

}
wait(1);
}

}

======================================================

if anyone notices whats wrong please reply. thx a lot.


If you do not know where you are . . .
Ask a villager.
Re: Help again [Re: DirtyDhan] #306233
01/20/10 16:07
01/20/10 16:07
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
seriously... how many times do I have to tell you...?
Stop making a million threads for the same problem, and stop giving them useless names! this makes it very hard for people to find the solution if they are facing the same kind of problem...

THANKS


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Help again [Re: Helghast] #306245
01/20/10 17:59
01/20/10 17:59
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
DirtyDhan, please don't post more than one thread for one problem. Also, please name your thready properly. Names like "Help again" won't help users who have the same problem finding you. Next time you post a double thread you might get a temp ban.

Re: Help again [Re: Lukas] #306305
01/21/10 02:20
01/21/10 02:20
Joined: Dec 2009
Posts: 24
DirtyDhan Offline OP
Newbie
DirtyDhan  Offline OP
Newbie

Joined: Dec 2009
Posts: 24
Sorry . . .


If you do not know where you are . . .
Ask a villager.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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