Hi there!
So I working on the movement in my RPG.
Now it is so:
The Hero goes AND runs 16 Pixel(keyPressed).
But now I want that the Hero GOES 32 Pixel. And run 16 Pixel.
So I thought Im using keyTyped, when the Player push LEFT he move 32 Pixel.If he hold it pressed he mobe 16.
BUT it dont work
Did I do something wrong in keyTyped?
[code=java]
public void keyTyped(int key, char c)
{
if(schalter.MovementAllowed){
switch(key)
{
case Input.KEY_UP:
if(used==false){
TypedUP=true;
used=true;
lastDirection=3;
movement=true;
}
break;
}
}
}
At my Movement Code
[code=java]
if(TypedRIGHT && schalter.player_x<Kollision.getWidth()-40
&& blocked[schalter.player_x+48][schalter.player_y+48] == false
&& blocked[schalter.player_x+48][schalter.player_y+61] == false
&& schalter.player_x +32 != npcKollision_X[0]
&& schalter.MovementAllowed)
{
p.x=p.x-32;
schalter.player_x=schalter.player_x+32;
}
EDIT: Ok I think I know how to make it without. Im using this…Or not -.-"