Hey,
Im struggling with creating a slide movement for my Actor.
Im using the basic SmoothMover class that you can Import and found this piece of code created by Super_Hipp @/topics/8306/0
v is a private double = 0 , but in the game it does not work. I checked that v does not get changed at any time which make me wonder.
Thanks for youre help.
if ( World.gamemode == 3) {
if (Greenfoot.isKeyDown("enter")) {
Wold.playerspeed = 800;
}
if(Greenfoot.isKeyDown("Up"))
{
if (v<0.9) {v+=0.1;}
else {v = 1;}
}
if(Greenfoot.isKeyDown("Down") && getY() < 450)
{
if (v>-0.9) {v-=0.1;}
else {v =-1;}
}
if (v>0.1 || v<-0.1) {move(v); v*=0.95;}
else {v=0;}
}
