touch on scene and grow my actor to that point help please

FirstDanFirstDan Member Posts: 208
edited May 2012 in Working with GS (Mac)
Hi all

Can the following be done in GameSalad?

I have an actor on a scene, when you touch on the scene i want my actors width to grow to the point of my touch.

Quite tricky todo --help required

Many thanks

Dan

Answers

  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    edited May 2012
    Rule:
    When touch is pressed:
    Timer, every 0.1 sec
    Change attribute: size X to "size X + 1"
    Change attribute: size Y to "size Y + 1"

    If you want to touch on the scene, and make every actor grow, you have to make additional attributes for each actor X and Y, and constrain X and Y of each actor to your attributes.

    Change the numbers as you like.
    Hope this helps! :)
  • FirstDanFirstDan Member Posts: 208
    @TheMoonwalls - just to help you further in what i want, exactly like a light saber
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Then look at the video on making a health bar the code is similar and then just make an attribute that logs where you touch.
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    edited May 2012
    This is a tricky one, because if you want the blade to grow, you have to also move it up.

    Make an integer attribute, let's say Blade - this is the blade length.
    And second attribute - BladePos - this will change the blade position (for the grow effect).

    Make a rule: when touch is pressed (or mouse button is down):
    Timer, every 0.5 sec:
    Change attribute game.Blade to "game.Blade+1"
    And change attribute game.BladePos to"game.BladePos+1"

    And in your blade actor you have to constrain actor Y size to game.Blade, and constrain actor Y position to game.BladePos.
  • FirstDanFirstDan Member Posts: 208
    @TheMoonwalls - thanks for the help buddy, i can't get it to work, no worries ill just have to scrap this idea
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    @FirstDan,

    Drop me your e-mail to themoonwalls@gmail.com I'll make you a template and send it in few minutes.

  • FirstDanFirstDan Member Posts: 208
    @FryingBaconStudios - far more complex than that
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    Just sent you the template I've made. Tell me if it works as you want.
  • FirstDanFirstDan Member Posts: 208
    @TheMoonWalls - exactly what i needed - awesome, thanking you greatly.
  • FirstDanFirstDan Member Posts: 208
    @TheMoonwalls - think i made a friend :)
  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    @FirstDan you sure do :)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Not really you want to grow an actor based on touch. So you base an actor to another actor with an offset and then log your x y of the touch area and then grow the light sabot actor to that spot. Could write that code in about 20 minutes.
Sign In or Register to comment.