Discuss Scratch

TankiOnlineDude24
Scratcher
5 posts

Teleporter

I can't figure out how to make a teleporter in my platformer game. Please. thank you
footsocktoe
Scratcher
1000+ posts

Teleporter

Make two sprites to be teleporters. sprite A and sprite B.
Make a third sprite to be the player sprite
Put this script in the player sprite…

foreveriftouching sprite A?thengoto sprite Bmove10stepsiftouching sprite B?thengotosprite Amove10steps

The “move” blocks are important. They need to be a big enough move so you are no longer touching the sprite you teleported to. Otherwise, you will set up a loop that never stops because the player will always be touching one of the two sprites.

Last edited by footsocktoe (Feb. 2, 2016 20:03:57)

liam48D
Scratcher
1000+ posts

Teleporter

teleporter spritewhenIreceivechange level or whatever broadcasthideiflevel#=3thengotox:xy:y where the teleporter object is placedsetteleport xtox where the player gets teleported to when it touches the teleporter spritesetteleport ytoy show a teleporter in level 3iflevel#=4then. . . same as above, but with different inputs show a teleporter in level 4. . . add more teleporter configurations here player spritewhenclickedforeveriftouchingteleporter?then. . . other movement scripts heregotox:teleportxy:teleporty "teleport" the player to that positionwaituntilnottouchingteleporter? in case the player gets teleported into the same teleporter or whatever the name of the teleporter sprite is
laithrocks
Scratcher
100+ posts

Teleporter

foreveriftouchingteleporter?thenrandomgraphiceffectsgotox:xdestinationy:ydestinationrandomgraphiceffects
ProjectMaker59
Scratcher
500+ posts

Teleporter

Moxiepo wrote:

https://www.google.com/search?q=doctor+who+police+box&biw=1366&bih=643&tbm=isch&imgil=AcOD8JXFWuFMFM%253A%253BP2Ni6x00SNAJbM%253Bhttp%25253A%25252F%25252Fwww.amazon.com%25252FTardis-Police-British-Rectangle-Refrigerator%25252Fdp%25252FB00CPDMC6U&source=iu&pf=m&fir=AcOD8JXFWuFMFM%253A%252CP2Ni6x00SNAJbM%252C_&usg=__hLa-PvjCV2IJBGxg3Iq2yJdQcTs%3D&ved=0ahUKEwiI3rq48NXMAhVJ8IMKHUhaDiUQyjcIOw&ei=-io1V4j5JcngjwTItLmoAg#imgrc=AcOD8JXFWuFMFM%3A
Please don't spam Moxiepo it doesn't help anyone

TankiOnlineDude24 wrote:

I can't figure out how to make a teleporter in my platformer game. Please. thank you
Try this
foreveriftouchingsprite1?thengotosprite2changexby10iftouchingsprite2?thengotosprite1changexby10

Last edited by ProjectMaker59 (May 13, 2016 15:00:48)

Powered by DjangoBB