How to keep the stick inside the base?
aracknor
Member Posts: 54
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.
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
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.
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.
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)
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.
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.
If so...this is your problem...but there may be a fix...please confirm...
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
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.
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.
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...