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

2016/3/9

How am I supposed to get this to move? It just moves my itself right now, but I need to be able to control it.

tn13673 tn13673

2016/3/9

#
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class mypaddle here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class mypaddle extends Actor
{
    public int speed = 5;
    /**
     * Act - do whatever the mypaddle wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        if(Greenfoot.isKeyDown ("down"))
        move (-speed); 
        if(Greenfoot.isKeyDown ("right"))
        turn (5); 
    }    
}
tn13673 tn13673

2016/3/9

#
Ignore, my teacher FINALLY got around to me.
You need to login to post a reply.