How to create diagonal lines with different lengths

Hello! I have a game that spawns straight lines and I would like to spawn diagonal lines that have different lengths that connect with the straight lines. Like the app

Will this be very hard to achieve?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2015

    Where are you spawning them from? Do you already know the starting and ending points (are both known, only one, or are they completely randomized)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @tatiang it starts at self . position. Y 1024 and the X position is completely random. It does start at 384

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited December 2015

    @http_gamesalad said:
    @tatiang it starts at self . position. Y 1024 and the X position is completely random. It does start at 384

    So how I would do it is build my sections of track as shapes and use custom collisions. Then spawn the random shape based on the previous actor location. So each section of track will spawn it's location based on the one before it. By having the previous actor itself do the spawning of the next actor you can make it's location via actor and not scene. Since you know the size of the previous actor you can setup a table with the related offset needed to have them line up.

    You could actually make the actors in two big pieces that cover a large area with the path and just change the scene background to the tan color. Think of it as one sheet and you cut out the path in the area can be the whole size of the scene, and then take the left and right pieces and make them custom shapes and then spawn them at the same x and y everytime. Just make the halfs the same size each time. This would he super easy.

Sign In or Register to comment.