Problem mit If-Then-Befehl unter Fenix


Achim

Member
Joined
Jul 25, 2006
Messages
223
Age
55
Location
Hamburg - Germany
Website
www.gp2x-station.com
Abend,

irgendwie scheint meine If-then-Abfrage nicht richtig zu funktionieren.

Anstatt die Abfrage zu interpretieren wie:

WENN GAMELOOPS = 2 IST ... tue irgendetwas

setzt Fenix den Wert der Variable GAMELOOPS auf 2 (obwohl dies nicht gewünscht ist)

:wacko:

Hier mal meine Code-Schnipsel:
Code:
if (gameloops=2)
zaehler+=1;
end

Folgende Schreibweise bringt es auch nicht:
Code:
if (gameloops==2)
zaehler+=1;
end


Danke für Eure Hilfe...

Gruß,

Achim
 
Ok ... es muss wohl heissen:

if ...==...:tueirgendwas;end
Code:
<i>
</i>// ------------------------------
// Test Program                  
// ------------------------------

global 
gameloop;


//Hauptschleife  
begin  

gameloop=1;

repeat

IF key(_1):gameloop=1; END
IF key(_2):gameloop=2; END
IF key(_3):gameloop=3; END

delete_text (0) ;

if gameloop==1:
write (0, 60,  60, 0, "Gameloop=1") ;
end

if gameloop==2:
write (0, 60,  60, 0, "Gameloop=2") ;
end

if gameloop==3:
write (0, 60,  60, 0, "Gameloop=3") ;
end


IF key(_0): BREAK; END
        
FRAME ;
UNTIL key(_0);    

//Ende Hauptschleife  
end

CYA !
 
ok.. hmm solche if statements hab ich noch nie benutzt bist du sicher das das fenix ist ? ;)

mfg
trucidare
 
So habs mal korrigiert funzt auch:
program testproggy;

global
gameloop;


//Hauptschleife
begin

gameloop=1;

repeat

IF(key(_1))gameloop=1; END
IF(key(_2))gameloop=2; END
IF(key(_3))gameloop=3; END

delete_text (0) ;

if(gameloop==1)
write (0, 60, 60, 0, "Gameloop=1") ;
end

if(gameloop==2)
write (0, 60, 60, 0, "Gameloop=2") ;
end

if(gameloop==3)
write (0, 60, 60, 0, "Gameloop=3") ;
end


IF(key(_0)) BREAK; END

FRAME ;
UNTIL key(_0);

//Ende Hauptschleife
end
 
hey core ich begrüß dich mal hier im gp2x-forum...
hab eine schöne zeit hier :)

und der code vona chim funzt auch ;)

mfg
trucidare
 
Back
Top