Need Help Please

pinata14pinata14 Member Posts: 150
edited March 2012 in Working with GS (Mac)
hey guys, do any of you know how to make an actor that behaves like a laser? This meaning that it shoots from a certain point (variable) in a certain direction or towards a point and terminates when it hits something, but stays in existence. It also has to constantly change its length based on what is in front of it so like if there is something 20 pixels in front of it, the laser will be 20 pixels long, then if that thing or the laser moves and the distance changes, the laser also changes its own length. Thanks,
Ryan

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Here ya go (had an example sitting on the desktop):

    http://www.mediafire.com/download.php?526tqh0gisn2c8u

    Hope that helps!
    RThurman
  • pinata14pinata14 Member Posts: 150
    hm :/ not exactly what I wanted sorry...
    I was looking for something that will be like that, except that it would stop when it collides with any object. like if the beam that you have were to cross another box, that box would terminate the laser at its position so I can make a "laser" weapon. I don't want to use many little actors that spawn fast because that would be sloppy and not make a straight line, and it wouldlag the game
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If you don't want to spawn actors to create the line, how about spawning a line (thin, long rectangular actor) from each side to the middle and then when another actor collides with them, interpolating a decrease in their width to make them appear to shrink away from the middle?

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2012
    How's this? http://dl.dropbox.com/u/19602014/laserv0.2.zip (click/tap the blue Player actor and drag it across the laser beam). I added sparks, too. :)

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

  • pinata14pinata14 Member Posts: 150
    sorry, but once again this doesn't work as it should, there should be a laser going from a movable object to somewhere else then change it's length based on what is in front of it. @tatiang yours simply decreases in a set direction as soon as it come in contact with the box. I need it to be constantly updated and can go in other directions.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @pinata14 Sorry, I didn't understand what you were wanting to do, but I would imagine you can just have the two actors I made move (constrain) and rotate (constrain) to wherever you need them.

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

Sign In or Register to comment.