src/Handler.java
/**
    * Loops through objects and calls their draw methods.
    * @param g [description]
    */
Loops through objects and calls their draw methods.
@param g [description]
Loops through objects and calls their draw methods . @param g [ description ]
public void draw(Graphics g){
        int n = 0;
        for(int x=0;x<objects.size();x++){
            GameObject obj = objects.get(x);
            if(obj.getId().equals(ObjectId.Platform)){
                if((Math.abs(Game.player.getX()-obj.getX())>=440 || Math.abs(Game.player.getY()-obj.getY())>=540) && obj.getX() >= 800){
                    continue;
                }
            }else if(obj.getId().equals(ObjectId.Text)){
                if(Math.abs(Game.player.getX()-obj.getX())>=700 || Math.abs(Game.player.getY()-obj.getY())>=540){
                    continue;
                }
            }
            obj.draw(g);
            n++;
        }
    }
public void draw ( Graphics g ) { int n = 0 ; for ( int x = 0 ; x < objects . size ( ) ; x ++ ) { GameObject obj = objects . get ( x ) ; if ( obj . getId ( ) . equals ( ObjectId . Platform ) ) { if ( ( Math . abs ( Game . player . getX ( ) - obj . getX ( ) ) >= 440 || Math . abs ( Game . player . getY ( ) - obj . getY ( ) ) >= 540 ) && obj . getX ( ) >= 800 ) { continue ; } } else if ( obj . getId ( ) . equals ( ObjectId . Text ) ) { if ( Math . abs ( Game . player . getX ( ) - obj . getX ( ) ) >= 700 || Math . abs ( Game . player . getY ( ) - obj . getY ( ) ) >= 540 ) { continue ; } } obj . draw ( g ) ; n ++ ; } }
Loops through objects and calls their draw methods.
Loops through objects and calls their draw methods .
// Optimization: Draw only on screen
