Help with actor behaviour

neomanneoman Member, BASIC Posts: 826
edited September 2012 in Working with GS (Mac)
Hello Every body,

I am new to game salad and would like some help. I am running the following:

MAC OS Mountain Lion 10.8.1
Game Salad Creator 0.10.0.0

I have created a simple game where you use a bar to hit a ball then the ball hits an object. The game has 3 levels. Each level is a new scene.

When I go from one scene to another I have to take my finger off the iPhone screen then touch it again to be able to control the bar in the new scene. The same happens when I run the game in game salad creator. I have to take my finger off the mouse then click it again to be able to control the bar in the next scene as well.

I tried to change the rule i.e. touch but not pressed etc then searched the forums with no success. Is there a way where I can move from one scene to another without me having to take my finger off the screen to control the bar again ?

The only way that I can think of to achieve this is to make all levels part of the same scene then spawn the actors in at each level but I would like to use a scene for each level.

Your help is appreciated.

Thank you in advance in anticipation of your assistance.

Cheers,

Neoman

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    The problem with your approach is that when a new scene starts, the actors on that scene check their rule conditions and respond according to the value of attributes in those conditions ONLY if those values change. In this case, Touch is Pressed has already happened, so it can't trigger a rule (that is, it doesn't toggle from Not Pressed to Pressed). I'm not sure how to get around this...

    [Lengthy aside:]

    @gyroscope, from a forum user's perspective, they are answering the question "Did this answer the question? Yes/No" When they choose No, it labels your answer as "Rejected Answer." I think the problem isn't with the action but with the resulting label. I, too, get annoyed seeing a bunch of rejected answers in a thread when everyone is trying their hardest to help out. But maybe there's a better label that could be used, such as "Partial answer" or maybe just no label.

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

Answers

  • carlblanchetcarlblanchet Member Posts: 755
    Try making a boolean attribute, lets call it Touch, that is changed to true the first time the bar actor is pressed. When Touch is true constraint the bar to the mouse.

    Then when it is game over, change Touch to false, as well as when pause is pressed. (if you have a pause that is)
  • neomanneoman Member, BASIC Posts: 826
    I created a boolean attribute "touch" then set a rule which changed it to true when the actor was pressed then I created another rule to constrain the actor bar to the mouse or touch 1 when the "touch" attribute is true but it did not have any effect. The bar still behaves the same. Am I doing something wrong ? Do you have any other ideas ?

    Thanks
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @neoman

    You could always not worry about keeping your finger on the bar.... just go to the next scene, and have a countdown with your finger ready to move the bar on zero... just a thought...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • neomanneoman Member, BASIC Posts: 826
    But the ball will fall and rest then the player will lose a life. The ball continues as expected in the next scene. The bar is the only actor affected by the change of scene.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2012

    I see, (well, sort of – not understanding your gameplay whereby you have a new level with a ball still in play. Bit unfair you pressing Rejected answer when I didn't know that aspect...).

    But as that's the case, then I'd say, with only 3 levels, just keep them all in one level using Spawn if needed, as you suggested yourself. That's my suggestion now.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • neomanneoman Member, BASIC Posts: 826
    That is the only way I could think of but was hoping I could avoid that if possible and achieve the same result a different way across the 3 scenes . I wanted to avoid spawning 25 different actors each time a level changes. I guess I will give that a go. Thank you for your help.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    You're welcome; hope it works out for you easier than you thought... :-) (Sorry about the rejected answer moan.... I've got a thing about that button....)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • J_PANJ_PAN Member Posts: 140
    you can always use different balls if that is what you mean :-S
  • neomanneoman Member, BASIC Posts: 826
    @J_PAN @tatiang @gyroscope Thanks guys for your help. I really appreciate it. I created a scene between each level to solve the problem and that seemed to sort of solve the issue. I only left the thread open to see if there is a better solution. Once again thank you.
  • neomanneoman Member, BASIC Posts: 826
    edited January 2014
    @J_PAN @tatiang @gyroscope @carlblanchet I just wanted to let you guys know that the issue was solved properly without the work around as I understood GS better. It was the code. I just had to reset the ball attribute at each new level. I didn't understand exactly how GS worked as it was my first game. Cheers for your help you guys are awesome ;-)
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Good to hear! :)

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

Sign In or Register to comment.