Spawning Actor (player character) after changing scene

ClownmrminghuiClownmrminghui Member Posts: 18
edited October 2012 in Working with GS (Mac)
Hello All,

I have an issue which I will like to seek some kind assistance from you guys. Basically I am very new to game development so do bear with me a little if the things I've said don't quite make sense.


The ideal situation I wanna achieve:

Player taps "Start game" button from main menu.
Player gets into in-game
Player's actor spawns at an exact position.

The situation now:

My character control is based on touches. The actor will move to the position according to the area of the screen I've touched.
When I transit from main-menu to in-game, my actor moves to the position where my finger was when I tapped the start button.

Anyway to get my actor to ignore first touch? Or to spawn my actor 0.1 second after changing screen?

Thanks in advance

Comments

  • ClownmrminghuiClownmrminghui Member Posts: 18
    I've tried this >

    On my start button :

    Rule - when actor receives touch event inside of actor , change screen
    Rule - when actor receives touch event inside of actor , spawn player actor at position 100,100 , after 2 second timer.

    Basically what was going through my head was, after tapping on the start button, scene will change, and the spawn will only take place 2 seconds after the touch. Because if there is no actor spawned, there is no way my actor control is going to work. By doing so, I thought I can effectively ignore first touch.

    However I was wrong, Lol.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited October 2012
    Have you tried this?

    Just place the player actor offscreen to start with and then on the player actor have this rule:

    image

    It sounds like you want the actor to move into place almost immediately after the scene starts. Or did you want the actor to move into place after the first touch on the (second) scene?

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

  • ClownmrminghuiClownmrminghui Member Posts: 18

    It sounds like you want the actor to move into place almost immediately after the scene starts. Or did you want the actor to move into place after the first touch on the (second) scene?
    Hello tatiang, I will like the actor to move into place after the first touch on the second scene
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Then just remove the timer from the above screenshot and wrap those Change Attribute behaviors in a When Touch is Pressed rule. If that doesn't work, is your actor present on the first scene?

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

  • ClownmrminghuiClownmrminghui Member Posts: 18
    Hi tatiang, that didn't work.
    But thanks anyway :)

    Anyone else with any idea?
  • ClownmrminghuiClownmrminghui Member Posts: 18
    And the actor wasn't present on the first scene.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Sorry, my fault... of course it's not going to work with When Touch is Pressed. I should have said When Mouse Button is Down. Try that.

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

  • ClownmrminghuiClownmrminghui Member Posts: 18
    Hi tatiang,

    No it doesn't work that way because the game is meant to be on iOS. Doubt the mouse function work ya?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Well, "Mouse Button is Down" just means a click OR tap anywhere on the scene.

    Here's a demo:

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

Sign In or Register to comment.