PDA

View Full Version : Movement



woad
October 7th, 2006, 10:52 PM
How can I create Dad n' me (http://www.pimp-lounge.misterbling.com/dad-n-me-p-63.html) style movement?

SacrificialLamb
October 7th, 2006, 11:31 PM
will you would have some thing like


if (Key.isDown(Key.RIGHT)){
_root.man._x+=10
}
if (Key.isDown(Key.LEFT)){
_root.man._x+=10
}
if (Key.isDown(Key.UP)){
//you might like to add in code to scale the unit here
_root.man._y+=3
_root.backGround._y-=3
}
if (Key.isDown(Key.DOWN)){
//you might like to add in code to scale the unit here
_root.man._y-=3
_root.backGround._y-=3
}
Then you would need some swap depth thing in there so the right people are behind each other, and make it so that you can only attack some one within so much X and less Y

woad
October 7th, 2006, 11:33 PM
Not really helpful but thanks for the idea of SwapDepths
Actually searching swapDepths(); is actually the missing piece of the puzzle using the source of this tutorial:
http://www.kirupa.com/developer/actionscript/swapdepth.htm

Joppe
October 8th, 2006, 05:43 AM
Could you explain what you mean by, "Not really helpful"?
It IS how a basic engine that looks the same way like Dad 'n me is built.
I mean, your question is a bit widespread, so this is the answer your getting. Deal with it.

woad
October 8th, 2006, 01:57 PM
"Actually searching swapDepths(); is actually the missing piece of the puzzle using the source of this tutorial:
http://www.kirupa.com/developer/acti.../swapdepth.htm"
As in something he said in his answer was really helpful, but the code wasn't. I never said I wasn't thankful for it.