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 / AGK Virtual Joystick Commands Needed

Author
Message
RJMSTATION
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location:
Posted: 4th May 2014 23:32
The snake snacker example game will broadcast to my phone. The phone menue says touch to play. touch screen not working or I need commands in order to configure. I set the Virtual joystick code in the snake snacker example where the Input From Player is located inserted AddVirtualJoystick ( 1, 20, 300, 30 )
I changed the "Box" in the Virtual Joystick Example to "1" to associate with the Snake Snaker head Image.
// main loop
do
etc. I see the joystick in lower corner ,but the game is frozen.
the snakehead is detached and moves controlled by mouse courser pointing onto the joystick visible during game. The rest of the snake segs body is stationary. the free floating head is not effected by obstacles in the game. Music plays while the game frozen. Any suggestions how to keep the snake snacker moving while controlled by mouse courser pointing onto the joystick visible during game? I also see a error if snake_xd=-1 at line 649 preventing phone broadcast when edited with virtual joystick commands. Any suggestions on how to enable virtual joystick in Example game SnakeSnaker?

Ronald Millian
RJMSTATION
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location:
Posted: 22nd May 2014 15:16
if vjx#>0 then print("RIGHT")

This code prints Right when I turn Right,but the Snake Snaker not turning. If I change code to

if vjy#>0 then VirtualJoystick=1 and snake_xd=0 and snake_yd<>1 and direc_change=0
snake_xd=0
snake_yd=-1
direc_change=1

Virtual Button had the same results
Are these the commands needed?

Ronald Millian
RJMSTATION
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location:
Posted: 22nd May 2014 15:49
I also tried this code that looked the most logical. Before this code would print Up when I moved up. I changed to this

if vjy#<0 then snake_xd=0 and snake_yd<>1 and direc_change=0
snake_xd=0
snake_yd=-1
direc_change=1


Although code for time and gamespeed was already in the code I had to add it again when adding virtual joystick in the Input section of Snake Snacker.

if time=gamespeed
time=0

this got the snake moving again.

Ronald Millian
RJMSTATION
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location:
Posted: 5th Jun 2014 19:41
I think what I need is How can I find out where is the Flag set based on the device that I am running on? AppGameKit player might be thinking it's running on a device with a keyboard. How do I force the Flag to Virtual Joystick?

Ronald Millian

Login to post a reply

Server time is: 2024-11-25 05:27:56
Your offset time is: 2024-11-25 05:27:56