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

2016/3/8

How to display line that I drew.

RedPanda98 RedPanda98

2016/3/8

#
I have followed Greenfoot's API and trying to create Wall class which will be used in the world to separate the controls and the particles of the world. How do I display the line and can this be used for collision detection?
import greenfoot.*;
public class Wall extends Actor
{
         
    public void drawLine(int x1,int y1,int x2,int y2) //draws a line
    {
        x1 = 100;
        x2 = 100;
        y1 = 450;
        y2 = 300;
    }  
    
}
You need to login to post a reply.