HELP WITH JOYSTICK ABLABLIBLA PLEASE

elimoraless

  • Posts: 39
Please I need a Joystick behavior for my one character, so i found that again theres a problem with stencyl and the Joystick doesn't work on mobile so i added the ablablibla extension and tried to make it work but no luck this is what i want:

Joystick movement 8 ways (up, down, left, right, and diagonals) speed 24 and when is not pressed speed 0.

and also important TRANSPARENT joystick and no  fixed position i need it where i press on the screen.       PLEASE SOMEONE HELP. This is what i have (see images).

Northfield82

  • Posts: 649
I have used the same joystick extension for similar movement with my game character.

Ignore the 2 multi-touch events as they are for shooting.  But try the rest of the code and see if you have any luck.

Level 1 Touch Control is a Scene behaviour attached to the Scene in question
Quasi_1_movement is an actor behaviour attached to the Player Actor

elimoraless

  • Posts: 39
I have used the same joystick extension for similar movement with my game character.

Ignore the 2 multi-touch events as they are for shooting.  But try the rest of the code and see if you have any luck.

Level 1 Touch Control is a Scene behaviour attached to the Scene in question
Quasi_1_movement is an actor behaviour attached to the Player Actor

Man thank you for the answer but i tried to understand but i can't, sorry for the ignorance.

There are few things that i hace no idea how they work so i don't know what to use and what to delete.

could you please tell me whats missing on my joystick or what i did    wrong please.

English is not my first language so sorry if im not clear enough.

Northfield82

  • Posts: 649
Is the joystick appearing when you touch the screen?

elimoraless

  • Posts: 39
Is the joystick appearing when you touch the screen?

Thank you for answering. Yes it does appear on the screen with the stencyl native joystick but doesn't work and with the ablablibla extension it does not appear on screen.

Northfield82

  • Posts: 649
What is the size of your screen? What device are you using?

elimoraless

  • Posts: 39
Iphone 5 screen size. OK on android the joystick works  great I actually have the game on my galaxy S5 but when I try the game on iPad or iPhone it doesn't work so I found out that native stencyl joystick have problems with ios they recommend use ablablibla extension so I did but I can't make it work not even android or ios..

Northfield82

  • Posts: 649
Try using these settings (under when created) and see if you get anything:

elimoraless

  • Posts: 39
Sorry for ignorance but i want to be 100% clear I make a new actors behavior and attach it to my actor right? Using these lines

Northfield82

  • Posts: 649
No sorry, I need to be clearer.

In the screenshots that you have posted.  Remove the first line 'add relative joystick...'

Create a Scene Behaviour, and attach it to the scene in question. Then under 'When Created' event, add those two blocks I pasted.  Remembering you have removed the 'add relative joystick...' block from yours already.

Also, try deactivating the blocks I have ringed.  I'm not sure they are needed...

Northfield82

  • Posts: 649
Also, you don't need the green 'as degrees' blocks, you can simply just type in the degrees as numbers.

See mine below- this is the behaviour attached to the actor which manages the movement of the player actor.

The other blocks attached to the scene set the joystick in place and set the speed for the movement.  It then checks to see if the 'distance' of the joystick is greater than 0 to see if it has moved. (This has a max of 1).  If it has moved a Boolean is set to announce movement should occur.  The direction is then pulled in from the direction block and speed applied.

All the other 'IF degree < or > etc' are just used to set what animation should be played.  The code to get the player moving should actually be quite straight forward

« Last Edit: March 05, 2015, 03:27:45 am by Northfield82 »

elimoraless

  • Posts: 39
Also, you don't need the green 'as degrees' blocks, you can simply just type in the degrees as numbers.

See mine below- this is the behaviour attached to the actor which manages the movement of the player actor.

The other blocks attached to the scene set the joystick in place and set the speed for the movement.  It then checks to see if the 'distance' of the joystick is greater than 0 to see if it has moved. (This has a max of 1).  If it has moved a Boolean is set to announce movement should occur.  The direction is then pulled in from the direction block and speed applied.

All the other 'IF degree < or > etc' are just used to set what animation should be played.  The code to get the player moving should actually be quite straight forward


MAN, GUESS WHAT I FINALLY DID IT!!!! THANKS TO YOU thank you so much im going to submit the actual code in case some one need  working 8 ways joystick show where pressed

Northfield82

  • Posts: 649
Well done mate, glad you got it sorted!