User Tag List

Results 1 to 4 of 4

Thread: Easiest Way to do a lot of Teleports?

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    May 2016
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Easiest Way to do a lot of Teleports?

    I'm putting together a game (simple top down, 8 direction movement) I'm not sure how to get teleports to work in the most efficient way in terms of programming. I know how to mechanically get them working, collide with the TP entrance, set position to TP exit, but the issue is that there's going to be enough teleports that hand coding collide with TP Entrance 1 -> Set Position to TP Exit 1 would take a long time and make adding new teleports later a pain.

    So my thinking was, give each set of teleporters (an entrance and an exit) a 3 digit code where the first digit is the level number and the other two are the teleporter number, for example teleport 5 in level 1 would be TP-105. I gave entrances the group TrapDoor and exits the group Target. The entrances have values Destination X, Destination Y, and TP Code, and the exits has the value TP Code. Right now the only event is if the player collides with a TrapDoor (an entrance) it sets the players x and y to the destination X and Y.
    My problem is, how do I tell TP-001 Entrance to set it's Destination X and Y to the correct Exit's X and Y?

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,661
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Something like this should work:

    * "Player" collides with "TrapDoor"
    + TPcode("Target") = TPcode("TrapDoor)
    - Set desitinationX("TrapDoor") to X("Target")
    - Set destinationY("TrapDoor") to Y("Target")


    The key is to do it this way

    * "Player" collides with "TrapDoor"
    + TPcode("Target") = TPcode("TrapDoor)
    - Set desitinationX("TrapDoor") to X("Target")
    - Set destinationY("TrapDoor") to Y("Target")

    and not this way

    * "Player" collides with "TrapDoor"
    + TPcode("TrapDoor)= TPcode("Target")
    - Set desitinationX("TrapDoor") to X("Target")
    - Set destinationY("TrapDoor") to Y("Target")

    Because even though the + TPcode("Target") = TPcode("TrapDoor) seems perfectly symmetrical, only the first (leftmost) item will allow Fusion to know precisely which instance of an Active you're talking about.

    In case you're wondering why the leftmost item is treated differently, here's the reasoning as I understand it. Imagine you replaced "Target" with 105. Then, this would make perfect sense:

    TPcode("TrapDoor) = 105

    Whereas this wouldn't quite seem right:

    105 = TPcode("TrapDoor)

  3. #3
    Clicker Fusion 2.5 (Steam)

    Join Date
    May 2016
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it, that works great! Thanks a ton, this saves loads of work!

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,661
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    That's great

Similar Threads

  1. Multiple teleports
    By Popcorn in forum File Archive
    Replies: 1
    Last Post: 14th October 2011, 12:16 AM
  2. Replies: 2
    Last Post: 25th August 2011, 01:42 AM
  3. Easiest way to check collision between two points?
    By Phanto in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 19th August 2011, 01:01 AM
  4. Easiest way to convert array to the ini object???
    By RickyRombo in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 27th February 2009, 02:17 AM
  5. Whats the easiest way to make a dragselection box?
    By MrCyberpunk in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 3rd July 2006, 03:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •