Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / how make one joystock and make my char move ?

Author
Message
Waldemar Lima
9
Years of Service
User Offline
Joined: 27th Nov 2014
Location: Brasil
Posted: 5th Dec 2014 21:58
hello everybody , how i can add one joystick input and make a connection with my character? (note = create a joystick to move my character)

PrintC("Hello EveryOne !&quot
BuccaneerBob
AGK Developer
14
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 6th Dec 2014 01:56
See this tutorial.

http://www.appgamekit.com/documentation/examples/input/3_moving_a_player.htm


You can also find a ton of other examples at:

http://www.appgamekit.com/documentation/examples.html

Robert Janes (Samu Games)
http://www.samugames.com/artifact
Waldemar Lima
9
Years of Service
User Offline
Joined: 27th Nov 2014
Location: Brasil
Posted: 6th Dec 2014 16:25
Thanks SamuGames ... for support !


I had to reformulate this code .... it was a little confusing and was not what I was looking for! as in the example above, in fact the player moves only in the X axis and Y axis ... the map that moves!

then to solve my problem, I removed the variables JoystickX and JoystickY ...
my code was as follows:

rem setWindowTittle this command, use only if you want !!
// SetWindowTitle ("Project 1")
SetWindowSize (800, 640, 0)

// Set Display properties
SetOrientationAllowed (1, 1, 1, 1)
AddVirtualJoystick (1,80,550,150)

LoadImage (1 "MySPRITE.png")
CreateSprite (1: 1)
SetSpriteSize (1, 50, -1)

SetVirtualResolution (800, 640)



of
SetSpritePosition (1 GetSpriteX (1) + (GetVirtualJoystickX (1) 5.0 *) GetSpriteY (1) + (GetVirtualJoystickY (1) * 5.0))
sync ()
loop


//endscript

PrintC("Hello EveryOne !&quot

Login to post a reply

Server time is: 2024-11-25 13:47:24
Your offset time is: 2024-11-25 13:47:24