Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | 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