Change scene question

Hi again!
How can I change scene by player press E and are inside the actor?

Comments

  • doug_smuppetdoug_smuppet Member Posts: 99
    edited March 2013
    Create 1 actor and 2 scenes

    on the actor you put:
    Rule:
    > Key: receives a key press: E is: down
    Do:
    > Change Scene: go to next scene

    and put you actor on the first Scene
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    What do you mean by inside the actor? Do you mean that your player actor is overlapping with another actor and when you press E, it changes to a different scene?
  • T0bsomT0bsom Member Posts: 9
    I mean front of. Sorry...

    When hero is in front of the actor(door) and press E change scene. If the hero is outside of the door and press E nothing happens. How can I do that?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Well there is no "front of" detection in GameSalad, but I think you mean when it's on one side of the door. You can check the hero's self.position.X or Y and if it's in the right zone (e.g. When self.position.X > 300 AND self.position.X < 360 if the door is at 330 or so) then allow the player to open it if E is pressed. Or you can have an invisible actor near the door and check for collision (and E is pressed). I'll make you a little demo.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here you go.
  • dmilinovichiiidmilinovichiii Member Posts: 620
    I think a better way of doing this would be using collision detection.

    If key E is down and actor is overlapping or colliding with the door,
    Then change scene.
  • T0bsomT0bsom Member Posts: 9
    Thanks for help! :D
Sign In or Register to comment.