+ 2
Java Processing - Click Button for movement
I wrote an entire program and got s button to appear. I want it to operate as an upButton. But i cant quite figure out exactly how do i link the button yo the movement of my player…. Someone please give my player life!!! i need my character to work from clicking the up button that i created. This is a phone game so there is no keyboard.
4 odpowiedzi
+ 1
This sort of code shall work
xVel=0; yVel=0;
void draw(){
If pressed.up(){ yVel = -speed}
...
... all four buttons
...
Player.x += xVel
Player.y += yVel
Lerp(xvel and yvel)
Hope this helps
+ 1
Thank You so much ill try it ive been trying to respond to you but sololearn says i haveny sctivated my account even though i already have ….
i will definitely try this and see if it works!!!
This is my button currently :
+ 1
welp the app wont let me paste a portion of my code either…. this is extremely unfortunate…. im sorry thank you for your help….
+ 1
I am still here