Portals?!
Hey all.
Crazy question. Can someone explain how to make portals in GS. I am of course referring to the game Portal. I obviously realize that GS doesn't do true 3D, etc. But I'm looking to have an element of it in my game (which is 2D). Cut The Rope (magic box) even has it too! And that's what I'm looking to do (like the magic hats in Cut The Rope).
Essentially I need objects entering one portal and exiting another portal (retaining the angle and velocity of its entrance)
Thanks so much!
Crazy question. Can someone explain how to make portals in GS. I am of course referring to the game Portal. I obviously realize that GS doesn't do true 3D, etc. But I'm looking to have an element of it in my game (which is 2D). Cut The Rope (magic box) even has it too! And that's what I'm looking to do (like the magic hats in Cut The Rope).
Essentially I need objects entering one portal and exiting another portal (retaining the angle and velocity of its entrance)
Thanks so much!
Comments
Xtenstudios@hotmail.co.uk
Cheers
"...Make 4 real attrributes: portalx, portaly, playermotx, and playermoty
in the 2nd portal have to change attribute behaviors
change portalx to self position x and change portaly to self position y
then in the player have a rule when it collides with the first portal
change self postion x to portal x
change self position y to portaly
change playermotx to self motion linear x
change playermoty to self moition linear y
then put a timer in that rule after .1 seconds run to complterion checked
change self motion linear x to playermotx
and change self motiion linear y to player mot y"
I'm still a newbie to GameSalad so I only half understand this. But I tried it and it works- sort of.
>This seems to work only one way (i.e. its not vice versa. it only works if player hits portal x it will pop out portal y- not both ways)
>I'm doing this with gravity (physics based) and doesn't seem to address this following issue... If I place portal X lets say on the ground and I place portal Y on the left hand wall. I want the players "ball" to drop into portal X and then launch outward of portal Y on the wall. The way the above "code" is set up, it doesn't take into account the direction of the portal facing.
ANy help on this would be greatly appreciated! "SlickZero" you may or may not have answered this but I'm new and that's a bit too advanced for my understanding- but a zillion thank yous for it (I'm sure it'll help those more advanced). And thanks everyone else for the input also!
Another example to be even more understandable.
Portal 1 is on the floor.
Portal 2 is on the left hand wall and it is facing the RIGHT HAND WALL.
Ball builds momentum and falls into portal 1 and shoots out of portal 2 (TO THE RIGHT HAND DIRECTION... NOT MOVING DOWNWARD). That's the trick, I don't want it to continue moving downward I want it to shoot out in the direction of the portal but maintaining it's momentum etc.
You guys are the best thanks!