<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package flappybirdclone;

import java.awt.Toolkit;
import java.net.URL;
import java.awt.Image;
import javax.swing.ImageIcon;

/**
 *
 * @author ppesq
 */
public class Pipes extends Base implements Constants {
    
        //variable imagen
    private ImageIcon pipeUp;
    private ImageIcon pipeDown;
    
    //private int xPipeUp;
    //private int xPipeDown;
    //private int yPipeUp;
    //private int yPipeDown;
    
    
    public Pipes() {
        super();
        int x = WINDOW_WIDTH;
        int y = (int)(Math.random()*343);
        this.setPosY(y);
        pipeUp = new ImageIcon(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(IMG_UPPERGREENPIPE)));
        pipeDown = new ImageIcon(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(IMG_LOWERGREENPIPE)));
    }
    
    public Image getPipeUp() {
        return (new ImageIcon(pipeUp.getImage())).getImage();
    }
    
    public Image getPipeDown() {
        return (new ImageIcon(pipeDown.getImage())).getImage();
    }
    
    public boolean checkPipeUpCollision(Base obj) {
        
        //if(obj.getPosY() < )
        return false;
    }
    <commit_msg>adding collisions to pipes<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package flappybirdclone;

import java.awt.Toolkit;
import java.net.URL;
import java.awt.Image;
import java.awt.Rectangle;
import javax.swing.ImageIcon;

/**
 *
 * @author ppesq
 */
public class Pipes extends Base implements Constants {
    
        //variable imagen
    private ImageIcon pipeUp;
    private ImageIcon pipeDown;
    
    //private int xPipeUp;
    //private int xPipeDown;
    //private int yPipeUp;
    //private int yPipeDown;
    
    
    public Pipes() {
        super();
        int x = WINDOW_WIDTH;
        int y = (int)(Math.random()*343);
        this.setPosY(y);
        pipeUp = new ImageIcon(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(IMG_UPPERGREENPIPE)));
        pipeDown = new ImageIcon(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(IMG_LOWERGREENPIPE)));
    }
    
    public Image getPipeUp() {
        return (new ImageIcon(pipeUp.getImage())).getImage();
    }
    
    public Image getPipeDown() {
        return (new ImageIcon(pipeDown.getImage())).getImage();
    }
    
    public Rectangle getPerimetro(){
            return new Rectangle(getPosX(),getPosY(),getAncho(),getAlto());
    }
    
    public boolean intersecta(Base obj){
            return getPerimetro().intersects(obj.getPerimetro());
    }
    
    public boolean checkPipeUpCollision(Base obj) {
        
        return false;
    }
    
{'fraction_non_alphanumeric': 0.11017803157541149, 'fraction_numerical': 0.002015451797111186, 'mean_word_length': 2.7506297229219143, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '338385', 'n_tokens_mistral': 913, 'n_tokens_neox': 914, 'n_words': 218}