Hello Guys,
i have a problem again. I want to make a boost-movement, so if q is pressed the movement will be double so fast like before. I have the script what works perfect. But if I press Q (Boost), W and A (So diagonal ) the boost works fine, WD and SA too, but if i press SD, the boost doesnt work. I dont find any error. I hope you can understand, what i mean.
Script for boost:
if(d<100){d++;} getWorld().showText("Boost:"+d,30,100);
if(d>0){ if(Greenfoot.isKeyDown("Q")){d = d-2;if (Greenfoot.isKeyDown("W")){ y= y - 2; this.setLocation(x,y);}
if (Greenfoot.isKeyDown("S")){y=y+2; this.setLocation(x,y);}
if (Greenfoot.isKeyDown("A")){x=x-2; this.setLocation(x,y);}
if (Greenfoot.isKeyDown("D")){x=x+2; ;this.setLocation(x,y);}}}
Thank You very much!