Gamestudio Links
Zorro Links
Newest Posts
Tradestation Multi-sessions??
by walt_Schwarz. 06/27/26 12:32
Z9 getting Error 058
by jcl. 06/26/26 14:07
ZorroGPT
by TipmyPip. 06/24/26 18:31
Lapsa's very own thread
by Lapsa. 06/20/26 18:18
Ranger by Robert Pardo - now for Zorro
by Smallz. 06/20/26 11:23
Z12 live performance
by jcl. 06/19/26 11:21
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 6,342 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_move problem #330890
06/30/10 14:47
06/30/10 14:47
Joined: Jun 2010
Posts: 29
N
Nomi Offline OP
Newbie
Nomi  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 29
Hallo leute ich habe ein problem mt dem bewegen von diesem pilz, er soll sich hin und her bewegen in die (x) axe aber ürgend wie geht leuft er immer in eine richtung.

das sind die skill einstellungen
my.skill1 -> 1600
my.skill2 -> 1800
my.skill3 -> 1500
my.skill10 -> 0

///////////////////////////////////////////////////////////////////////////

function pilz_dead ()
{
if(gegner_timer == 0)
{
if(event_type == EVENT_IMPACT && you == player)
{
herzleben += 50;
wait(1);
ent_remove(my);

gegner_timer = 1;
wait(-2);
gegner_timer = 0;

}
if(event_type == EVENT_IMPACT )
{
wait(5);
ent_remove(me);
}
}
}

////////////////////////////////////////////////////////////////////////////
action Pilz ()
{
my.emask = (ENABLE_IMPACT);
my.event = pilz_dead;
var anim_percent1 = 0;
var posiplus = 1;
my.x = my.skill1;


while(1)
{


if(posiplus == 1){my.skill10 = -5 ;my.pan = 90;}
if(posiplus == 2){my.skill10 = 5 ;my.pan = -90;}

anim_percent1 += 6*time_step;
ent_animate(my,"frame",anim_percent1,ANM_CYCLE);

if(my.x == my.skill2) {posiplus = 1;}
if(my.x == my.skill3) {posiplus = 2;}

c_move(me, nullvector, vector(my.skill10*time_step, 0, 0), NULL);


wait(1);
}
}

Last edited by Nomi; 06/30/10 14:48.
Re: c_move problem [Re: Nomi] #330893
06/30/10 15:17
06/30/10 15:17
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Code:
if(my.x == my.skill2) {posiplus = 1;}
if(my.x == my.skill3) {posiplus = 2;}



->

Code:
if(my.x >= my.skill2) {posiplus = 1;}
if(my.x <= my.skill3) {posiplus = 2;}



Es ist trotzdem kein besonders schöner Code, aber zumindest sollte es so funktionieren.


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