Help me with this effect

Non-platform specific questions.

Help me with this effect

Postby Wayra Condor » Wed Mar 05, 2008 9:10 pm

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:
Current proyect: The King of Peru 3 (0,1%...Now reutrning form a long break!)
User avatar
Wayra Condor
 
Posts: 27
Joined: Sat Dec 08, 2007 5:05 pm
Location: Cuzco, Peru
Score: 1 Give a positive score

Re: Help me with this effect

Postby edh » Wed Mar 05, 2008 9:31 pm

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.
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron