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.

Newcomers AppGameKit Corner / [SOLVED] [Help]Virtual Stick not working

User Offline
Joined: 21st Dec 2019
Location: Taiwan, Taipei
Posted: 23rd Dec 2019 15:39 Edited at: 23rd Dec 2019 16:13
Hi all,

I am a beginner and I start learning from Youtube toturial. Running AGK2 classic from Windows 10 Pro x64 laptop.
When I go to lesson two "AppGameKit Tutorial #02 - Load an image, create a sprite and move it!" (see link#1 below), I found I can't move my sprite even using the same code. So I go to Home>Examples>Joysticks page, copy same code , modify only image filename, try run it and the sprite still not move, even the on screen GetSpriteX, and GetSpriteY always show 0. Also I try plug a full size USB keyboard into my laptop and still not working. Here is my code, hope someone can help me.

Link #1:


Stanley Hsu

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 23rd Dec 2019 17:11 Edited at: 23rd Dec 2019 17:25
This post has been marked by the post author as the answer.
your code ran fine for me; a couple thoughts:

if you don't have a touch screen, use the WASD keys to move. i only 1/2-heartedly listened to the video but i didn't hear him state more than "use the keyboard" advice (you might be trying to use the arrow keys like i did on first run).

when it comes to a physical/usb joystick, make sure that it's plugged in before you run the app or AppGameKit won't know it's there/connected (i expect the same when plugging a keyboard in).

add: in the example, i'm not sure why the SetJoystickScreenPosition () is included as it's not necessary where an actual virtual joystick won't show on screen unless it's added manually.
G-Breaker WIP and Page.
User Offline
Joined: 21st Dec 2019
Location: Taiwan, Taipei
Posted: 24th Dec 2019 15:04
Hi Virtual Nomad,

Thank you, WASD key works, and all the test codes are running smoothly.

You solve my question.

Happy Merry Christmas,

Stanley Hsu

Login to post a reply

Server time is: 2020-07-04 12:28:25
Your offset time is: 2020-07-04 12:28:25