Hi, can you help me how to draw a Line in greenfoot? Our teacher give us this and we dont know what to do.
For this task, try creating a "drawRow" method that draws a horizontal line from edge to edge. And a method that draws a purple circle.
we did this and its not working
please help us thank uuu
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class line here.
*
* @author Nicol Ševčíková
* @version 1.0
*/
public class line extends Actor
{
private GreenfootImage img = new GreenfootImage(50,50);
public void drawLine () {
img.drawLine (0,0,50,50);
img.setColor (new Color(100,50,0));
}
}