Discuz! Board's Archiver

Jorge posted on 2011-11-10 01:59

solved[action moveto]

[i=s] Last edited by Jorge on 2011-11-10 05:02 [/i]

Hello, I'm trying to develop a game with papaya engine, but I think the action moveto is not working properly.
If I have a sprite called hero:
hero.pos(32,32);
hero.addaction(moveto(1000,600,32));
trace(str(hero.pos()));

the trace returns [32,32] but should return [600,32]
Am I wrong? thank you

jihoonk posted on 2011-11-10 04:01

Hi,
Instead of hero.moveto(1000,600.32), please try hero.addaction(moveto(1000,600,32))
Also, tracing position of hero right after  moveto probably will not print out (600, 32) because it takes 1 second for your hero to move to such position.  

hope this helps.

Thanks.

Jorge posted on 2011-11-10 05:01

I edited my post to add the "addaction", sorry about the mistake.
You are right, it takes a second to update position, thank you!!:D
Page: [1]

Powered by Discuz! X1.5 Archiver   © 2001-2010 Comsenz Inc.