Hi all,
Im in the process of making an art based side scrolling platform game. All has been well up until now when I decided to add a moving platform.
The way the game works is the background is one large MC with a background image and a hidden MC with the platforms drawn on and it all scrolls as one. So for me too add a moving plaform I animated the platform inside an MC and placed it inside the drawn platforms MC. The moving platform then becomes part of hitest so my hero character is hiting the platform but it just moves from under him. I ran a search over the boards but nothing I can see will fix this problem. I though this would work but it doesn't:
pretty hard, that one. art based is not an ideal solution for too interactive games like that...
anyway, saying that i kept with art based method very long :-P
maybe try:
code:
onClipEvent (load) {
//speed of the platform
speed = 2
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero._x, _root.hero._y, true)) {
_root.hero._x += speed;
}
}
if you want additional infos about that hitTest method, just look at the sticky thread... other than that, i don't know where are the _x=0 and _y=0 points of your character, you may need to add/change little things like
Thanks Marmotte,
Got it to work with your second bit of advice, prob is the way I wanted the platform to work was move left 'pause' then more right 'pause'. The hittest was a little dodgey so ill probably just leave it for now find somthing that will fuction better.