This site requires JavaScript, please enable it in your browser!
Greenfoot back
Randy.
Randy. wrote ...

2016/3/19

360 Car Driving

Randy. Randy.

2016/3/19

#
Works great! except I'm not sure how to get the car to drive in the direction it's facing, I tried move(); but it moves the car sideways, even when changing move(); to a positive and negative int
if (Greenfoot.isKeyDown("left") ) {
            setLocation (getX()-2, getY());
            turn(-3);
        }
        if (Greenfoot.isKeyDown("right") ) {
            setLocation (getX()+2, getY());
            turn(3);
        }
        if (Greenfoot.isKeyDown("up") ) {
            setLocation (getX(), getY()-2);
        }
        if (Greenfoot.isKeyDown("down") ) {
            setLocation (getX(), getY()+2);
        }
Randy. Randy.

2016/3/19

#
Nevermind I got it
You need to login to post a reply.