How to keep the stick inside the base?

aracknoraracknor Member Posts: 54
edited November -1 in Working with GS (Mac)
I wonder what would be the rule if I want to use the joystick without the game touch?
With what should I substitute the game.Touches.touch1.x and y so the stick can move the same way and the when released snap back to the center of the base.

Comments

  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hi aracknor, have you discovered the solution to this? I think it may help me in my joystick-touch dilemma
  • aracknoraracknor Member Posts: 54
    No I have not been able to find the way. Please somebody help...
  • aracknoraracknor Member Posts: 54
    Ideas Please...
  • aracknoraracknor Member Posts: 54
    I cant because I have lots of buttons And when I press any of the other buttons and then the stick, it snap to the direction of the previously pressed button and that affects my game. Thats a known problem and there are a couple of post about it, so since the problem is the touch I am trying a way to use the Joystick but without the touch rule. So I am looking for a substitution rule to be able to use that kind of joystick. If anybody has any idea please... help is needed.
  • aracknoraracknor Member Posts: 54
    anyone, somebody please...
  • synthesissynthesis Member Posts: 1,693
    Codemonkey's joystick demo(s) work VERY well. Use those first. Then if you have other buttons interfering with the joystick operation...you need to redesign the logic that makes those function so that they do not interfere.

    Without knowing every specific issue in all your buttons...I think it would be hard for the forum to debug it based on small descriptions or without investing a substantial amount of time...which I imagine many are quite busy debugging their own projects.

    I recommend you build that joystick first and make it work perfectly...then build the other UI elements so they operate completely independent of the joystick...and not sharing any attribute definitions. It sounds to me like you have some buggy touch sequences that are triggering multiple events that conflict with one another.
  • aracknoraracknor Member Posts: 54
    Hi Synthesis:
    I am using codemonkey's joystick and it does not work properly if you have 1 or more buttons.
    Check it out, even in his demo if you put a finger to the side let say to the right of the joystick and then try to move the stick to let say up or right or down it will move to the right ( to the direction you put your finger previously). If it does not happens in the first one try again, it will happen.
    So let say that you have a game were you use the joystick to move and a fire button to shoot, if you keep pressing the fire button and you release the joystick and then touch it again it will travel to the direction of the button.
    But even without the button, go to the codemonkey's demo and put a finger anywhere beside the joystick and with the other finger move the joystick to another direction ( not to where your other finger is) and you will see.
    So since It looks like this joystick has trouble to work properly if you have more buttons I am trying to find a way to use the joystick but without the touch, because that is the problem, the touch. The joystick tries to move to the touch but if you are pressing the fire button the Joystick moves to that direction because there is where the touch is.
  • aracknoraracknor Member Posts: 54
    Oh and synthesis, I really understand that everybody is very busy with their own projects, I really do, I am just trying to keep this question in the first page because not many people look at the second one and to tell you the truth I been 3 days stuck in this and I am desperate.
  • synthesissynthesis Member Posts: 1,693
    I've been in your shoes before...we all have..

    One thing I thought of you might try is put all of the rules in each of your buttons (at least all of the rules involving touch sensors) inside a rule that says...

    When Touch is Inside.

    This will make sure the internal behaviors are only activated when the finger is actually ON the button/joystick and will isolate the rule sets. I have found touches can fire regardless of whether the actor is touched or not...which I have chalked up to a bug. Maybe this will fix the issue. If not...I'm out of ideas for now...perhaps someone else will have one...

    Otherwise...I recommend trying another approach. There have been MANY times where I have rebuilt a logic sequence in scene 3 or 4 times until I got it to work properly. Eventually you can get it to work...stubborn as it may be.

    (my report)
    http://gamesalad.com/forums/topic.php?id=10012

    My use of the Codemonkey joystick in a previous game:
    http://gamesalad.com/game/play/46197
    (however I wasn't shooting at the same time)
  • aracknoraracknor Member Posts: 54
    Yes I figured that if there are more than one thing interacting with the same touch it may be problematic. So that is what I am trying to do, rebuilt the logic or taking another approach.
    What I am trying is to put actors around the base so when the stick overlaps with them the actor will move to the direction assign to that actor. The problem is that I don't find the way to make the stick snap back to the initial position. What I am looking for is that rule, the rule that will let me use the stick but without the touch.
  • aracknoraracknor Member Posts: 54
    Or another question could be, how to constrain the touch to an area where it does not interact with the buttons and then how to modify the stick rules to work with it?
  • synthesissynthesis Member Posts: 1,693
    I just don't follow what you are trying to do with the joystick. How do you use a joystick without a touch?
  • aracknoraracknor Member Posts: 54
    Ok since the touch is the problem ( the actual game.touches.touch) I wonder if I can find another way to make the joystick work (when you touch it, it will move and when you release it, it will snap back) but without the game.touches.touch rule. Maybe with another movement rule or something. I also found that it does not work either with the game.mouse rules. If I find the way to make the joystick work I can put some actors around the base (actors with movement rules in them, you know one for up one for down, right, left and maybe diagonals to) so when the stick actually overlaps or collide with them the payer move as if it were been move by the joystick. My game has a lot of buttons on the side and they make the joystick inoperable.
    Synthesis I thank you for your patience and I know that I am asking for something that may not exist or maybe it cant be done.
    But I am really thank full for all the time you have put into this.
  • synthesissynthesis Member Posts: 1,693
    So you are dragging the joystick OVER the top of the other UI?
    If so...this is your problem...but there may be a fix...please confirm...
  • aracknoraracknor Member Posts: 54
    UI? I dont know what does UI mean. Sorry
    But that sound like what I am trying to do be able to drag the stick and when I release it, it will snap back
  • synthesissynthesis Member Posts: 1,693
    UI = User Interface.

    Are you dragging your joystick over the top of your other buttons? If so...are you are pressing the other buttons while using the joystick?

    If so...you might need to create a game attribute that tells the other buttons that the joystick is in use.

    What it sounds to me is a complicated User Interface. It may need simplification. Don't know without getting into it first hand.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hi I am working on a demo to be able to explain this a little bit better I been following this post and other post about the joystick because I am creating a game that uses the joystick and a couple of side buttons and it is not working for me either.
    A couple of weeks ago I created the post titled The course of the phantom touch without any luck so let see if we can resolve this in this one.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hey aracknor I created the demo but I just realize that the Idea of having the joystick touching the actors with the move rule will not work because the problem is the actual movement of the joystick and not what the movement of the joystick produces. so by touching the other button the stick will move to that side and it will still touching the actor that is now producing the move.
  • aracknoraracknor Member Posts: 54
    this is a labyrinth... yes I know, what I was looking for is for that set of rules that will allow me to use the joystick but withou the game.touches.touch rule.
    Frankly I will leave this aside and I will concentrate in another game. This has been to much. I will comeback to this in a couple of weeks to see if this has been solve. thanks everyone for the help, is not taht I am quiting its just that I will take somethime to gatter my strenght, regroup and come back stronger...
Sign In or Register to comment.