move actor through moving platform from one side only

iNabarawyiNabarawy Member Posts: 4
edited November -1 in Working with GS (Mac)
hello there every one , I'm a newbie here at game salad i spent the last couple of month learning objective-c and working with cocos2d engine for building games , while that is going terribly slow ! i found game salad and i loved working with it , while i don't like the restrictions when it comes to tweaking the x-code project anyway i'll get to the point
I'm trying to move an actor throw a moving platform imagine the moving platform in doodle jump but i want my actor to stay on the platform and move with it ,
i managed to get the actor throw the platform only when it's movable property is set to false , when i check it to true the actor moves throw it and then fall back throw it again !

what am i missing here?
would some one help?

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Check out my YouTube account, I have a video on there saying how.



    Ace
  • iNabarawyiNabarawy Member Posts: 4
    I watched your video this morning and that's how i got this far in the first place !
    thanks a million by the way but imagine the green,red &blue platforms moving right and left in a specific part of the screen why wouldn't the same technique work?! i've been trying for hours now !
  • PhoticsPhotics Member Posts: 4,172
    I didn't watch the video, but wouldn't a rule work?

    If player.x.position is greater than self.position x (plus some offset)
    Then collide with player X

    Otherwise, nothing.

    So, in a side-scrolling game, the player could walk through that door, but not return.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Should work fine, are all your attributes set up properly?

    You could send your project to info@instantmashgames.com if you still get stuck at it and I'll take a look

    Ace
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Thats what the video says, but adds the offset with some simple math so it can be whatever size, etc

    Ace
  • iNabarawyiNabarawy Member Posts: 4
    it turned out to be a bug in my game salad creator itself !
    i don't know how but i started a new project from scratch and everything worked as it should be !
    thanks folks , i appreciate your help :)
    while i have you hear , what's the best way to keep a platform moving at a constant speed between the two edges of the screen without it being affected by the gravity of friction with the actor jumping on it? :D
    i solved the affection by gravity part i did a constrain attribute and constrained the position.y to the y i want on each platform but what about the other part?
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Use interpolate, if self.x = (the x position on the left and put the platform in this position) interpolate self.x to (the x position on the right)

    Then do the opposite, so if self.x = (right hand x) interpolate to left x

    Ace
  • iNabarawyiNabarawy Member Posts: 4
    thanks a million !!!
    i hope i wasn't much trouble :)
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    That's what the forums are for :)

    Ace
Sign In or Register to comment.