how to make a teleport?

idoistuffidoistuff Member Posts: 197
edited November -1 in Working with GS (Mac)
I have a ball game where I click the screen and a ball appears (and bounced with gravity)

I was wondering how I would make a teleport so if the ball goes in the left side of the teleport1 it would come out the right side in teleport2

or if it goes in the right side it will come out the left.

also I would like it so if the ball goes through teleport1, bounces back off a wall at teleport2 it would go back through to teleport1. (do you understand? I suck at explaining)

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    I was making a teleport today for Ants but the mechanics are different to what you mean. You would just have to calculate which way the ball is moving with linear velocity and then change the X & Y values to the other teleportation actor. Make sure you make the X & Y values go to either the left or right of the teleport actor or it will just keep teleporting back and forth.

    Ace
  • VoidedSkyVoidedSky Member Posts: 1,095
    Have a rule on the ball like this:
    --when collides with teleport one:
    ---change attribute self.positionX to game.teleportTwoX
    ---change attribute self.positionY to game.teleportTwoY

    Do he same thing for teleport two, but with opposite attributes.

    Have a change attribute in teleport one like this
    --change game.teleportOneX to self.positionX
    --change game.teleportOneY to self.positionY

    Do the same with teleport two, but with teleport two attributes.

    Hope I helped!

    ~CTM

    EDIT: haha @Ace, we were posting at the same time!
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    @CoweTech Great minds an' all that ;)

    Ace
  • idoistuffidoistuff Member Posts: 197
    so do I make 4 attribute integers?
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Yeah, 4 and you want to make them as Index, not integers.

    Ace
  • idoistuffidoistuff Member Posts: 197
    CowTechMan said:
    Have a rule on the ball like this:
    --when collides with teleport one:
    ---change attribute self.positionX to game.teleportTwoX
    ---change attribute self.positionY to game.teleportTwoY

    Do he same thing for teleport two, but with opposite attributes.

    Have a change attribute in teleport one like this
    --change game.teleportOneX to self.positionX
    --change game.teleportOneY to self.positionY

    Do the same with teleport two, but with teleport two attributes.

    Hope I helped!

    ~CTM

    EDIT: haha @Ace, we were posting at the same time!

    so wait, you said "Do he same thing for teleport two, but with opposite attributes." what do you mean?
  • idoistuffidoistuff Member Posts: 197
    that tutorial is great tshirtbooth, but only if I had one level with one teleport.

    in that video the guy puts the position of the teleport in the player actor.

    so that means in each level I would need my teleports in the SAME spot.. which I don't want.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Just have a real attribute called Teleport 1 x and Teleport 1 Y for each teleport and in the teleport actor, just have a change attribute that changes Teleport 1 x to self.position.x and same for Y, then you can use it on any level and will update itself.

    Ace
  • idoistuffidoistuff Member Posts: 197
    I don't quite follow.. this is what I have so far..

    http://dl.dropbox.com/u/11172522/teleport.png
  • idoistuffidoistuff Member Posts: 197
    so it does teleport, but not from tele1 to tele2, for some reason each teleport just teleports to the bottom left of the screen..
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    It looks like you have both rules telling it to come out of the same portal. They both have portal1 as the target destination. Is portal1 the one on the bottom left of the screen?
  • idoistuffidoistuff Member Posts: 197
    I don't know if this will work.. but here is my gamesalad file.

    http://dl.dropbox.com/u/11172522/Click Holes.zip

    its just easier if someone looks at it.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you need to watch the tutorial better, u did it wrong

    having a rule attirube whatever = self position x will do nothing. you need to constrain each attributee to its position
  • idoistuffidoistuff Member Posts: 197
    I am new to game salad, just started a few hours ago so I cant understand the tutorial or anything
Sign In or Register to comment.