Page 1 of 1

Help me with this effect

PostPosted: Wed Mar 05, 2008 9:10 pm
by Wayra Condor
In the game I'm making I'm using a matial art system similar to the ones on "mortal kombat", and I'm trying to make that effect with no result, this is what happens:
I'm trying the following secuense: when certain button is pressed the martial art title go down out of the view and then returns from bellow but with a diferent name, for this I tried this code:

Code: Select all
if (martial_art_act1==0)//martial_art_act1 is a variable for this
{
    CreateTimer("Event Actor", "tiempo_de_canje", 1000);//tiempo_de_canje is the time it takes on the action
}

if (martial_art_act1==1)
{
    CreateTimer("Event Actor", "tiempo_de_canje2", 1000);//same a tiempo_de_canje
 
}
 


And I'm putting on timers:
Code: Select all
p1_artemarcial.yvelocity=p1_artemarcial.yvelocity+10;//p1_artemarcial is the text name actor for this
 
p1_artemarcial_b.yvelocity=p1_artemarcial_b.yvelocity+10;//same here

martial_art_act1=1;


In tiempo_de_canje2:
Code: Select all
strcpy(p1_artemarcial.text, "CHOLITZU");
 
strcpy(p1_artemarcial_b.text, "CHOLITZU");

p1_artemarcial.yvelocity=p1_artemarcial.yvelocity-10;

p1_artemarcial_b.yvelocity=p1_artemarcial_b.yvelocity-10;

martial_art_act1=0;


Also I add a collision state with frame in order to make those texts stay in a certain range:

For some odd reason (or maybe because I still don't master GE) this code don't work, what happens is that pass some seconds when nothing happens and later the text go down and never return.

I hope you guys can solve my trouble because I don't know what to do.
Thanks :mrgreen:

Re: Help me with this effect

PostPosted: Wed Mar 05, 2008 9:31 pm
by edh
Try this example...
ChangeText.zip
Change text offscreen.
(78.45 KiB) Downloaded 76 times

Click the text. It will float up out of sight, change it's text and float back down, resting somewhere near where it started.