Can controls continue to register across a scene change?

bloomerbloomer Member Posts: 53
edited February 2012 in Working with GS (Mac)
Hi guys. I'm doing an adventure type game split into different rooms. EG - You walk off the edge of scene 1 and you are moved to the left edge of scene 2. Each room/area is a scene. You can also go north/south and some rooms have more than 1 exit.

The problem I'm facing is that the virtual joystick can't be held across the scene change. So if I exit stage right by holding the joystick to the right, I'd like to still be holding the stick to the right so I keep walking to the right in the new room. But no action registers on the joystick touch area in the new scene until I take my finger off / release the mouse button. So in the new room, the player just stands in the doorway til I retouch the stick area.

The joystick's a digital one I made myself (8 compass points and a centre) not one of the analog template ones. It's built pretty much all out of game attributes, so values can't snap back when the new scenes come up.

Any advice/ideas on what I could do to get this working?

Comments

  • POMPOM Member Posts: 2,599
    edited February 2012
    I believe that you are using "when touch is pressed" in your joystick rules , maybe try to change it to "when touch is inside" type of joystick ,
    Sure you gonna have to make some adjustment , but its possible, give it a try..

    Roy.
  • bloomerbloomer Member Posts: 53
    Thanks for the idea Roy. I'm using 'touch is pressed' to activate the joystick, then 'touch is inside' to detect where the finger is. I thought that I already experimented with using 'inside' for both last night in response to this problem. But I've got the stick configurable so you can move it to the left side of screen or right. That means when a scene begins, the stick immediately moves into the appropriate position from offscreen. I wonder if that tiny break in continuity (if it is one) can break the touch?
  • bloomerbloomer Member Posts: 53
    edited February 2012
    OK, I've tested this scheme with a few changes to my original setup:

    1. I now use only 'touch inside' to register a touch on the joystick pad.
    2. I don't even move the pad into position in a new scene with behaviours: instead, the pad is in position already on both screen 1 and screen 2.

    In the GS Preview, with a mouse standing in for touch, it seems a touch on the pad still doesn't persist across scene changes. This makes me wonder if it's possible.

    Can anyone demonstrate how to do it? Or does anyone know for sure that it's impossble? Thanks.
  • bloomerbloomer Member Posts: 53
    I made a tiny downloadable demo that suggests it's not possible:

    http://home.iprimus.com.au/bloomer/disallow/persistence_demo.zip (15kb)

    In scene 1, touch anywhere inside the blue button to move to scene 2.

    In scene 2, a yellow button is where the blue button was, and shows a message when it's being touched.

    If you click on the blue button in scene 1 and don't release the mouse button, you'll move to scene 2, be holding the mouse button down, and the touch on the yellow button won't be registering til you release and click again.

    I'd still appreciate anyone's feedback, ideas or workarounds, since I've only been using GS in-depth for a few weeks now. Cheers.
  • MotherHooseMotherHoose Member Posts: 2,456
    of course a touch specific to an actor in a scene don't persist in other actors in other scenes…
    especially as the mouseEvent has fired and needs to register again to fire something else

    that said:

    gameAttribute: real type … name mouseLastX
    gameAttribute: real type … name mouseLastY

    just before sceneChange:
    -changeAttribute: mouseLastX To: game.Mouse.Position.X
    -changeAttribute: mouseLastY To: game.Mouse.Position.Y

    joystick:
    Rule: when
    Event: mouse is inside
    --Rule: when (All)
    --game.Mouse.Position.X = game.mouseLastX
    --game.Mouse.Position.Y = game.mouseLastY
    ----do this
    --Otherwise: -- do that

    @};- MH
  • bloomerbloomer Member Posts: 53
    Thanks MH.

    > of course a touch specific to an actor in a scene don't persist in other actors in other scenes…
    > especially as the mouseEvent has fired and needs to register again to fire something else

    Yeah, I just wasn't sure if there was a more general 'finger on the screen' sense that could persist.

    Re: saving mouse possie. Thanks for the suggestion, I'll have a look into that. I was trying to think of some kind of save stats/recall stats trick along those lines.

    If I can't get it all to work, my workaround may be to just use fewer scene changes and have some little rooms I might have put in scenes of their own on the same scene as the hubs they come off.
Sign In or Register to comment.