<commit_before>package com.udacity.gamedev.firstdemo;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool;
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.Array;

public class UdacityScreen extends InputAdapter implements Screen {

    SpriteBatch batch;
    Texture logo;
    ParticleEffectPool touchEffectPool;
    Array<PooledEffect> effects = new Array<PooledEffect>();

    private static final Color UDACITY_ORANGE = new Color(228.0f/225.0f, 127.0f/225.0f, 57.0f/225.0f, 1.0f);
    private static final Color UDACITY_BLUE = new Color(36.0f/225.0f, 73.0f/225.0f, 96.0f/225.0f, 1.0f);
    private static final float LOGO_WIDTH = 200.0f;
    private float logoHeight;

    @Override
    public void show() {
        batch = new SpriteBatch();
        logo = new Texture("udacity_logo_white.png");
        logoHeight = logo.getHeight() * LOGO_WIDTH/ logo.getWidth();

        ParticleEffect touchEffect = new ParticleEffect();
        touchEffect.load(Gdx.files.internal("UdacityEmitter.p"), Gdx.files.internal(""));
        touchEffect.setEmittersCleanUpBlendFunction(false);
        touchEffectPool = new ParticleEffectPool(touchEffect, 1, 2);
        Gdx.input.setInputProcessor(this);
    }

    @Override
    public void render(float delta) {
        // TODO: Make this UDACITY_BLUE instead
        clearScreen(UDACITY_ORANGE);
        batch.begin();
        batch.draw(logo,
                (Gdx.graphics.getWidth() - LOGO_WIDTH)/2,
                (Gdx.graphics.getHeight() - logoHeight)/2,
                LOGO_WIDTH,
                logoHeight);
        for (int i = effects.size - 1; i >= 0; i--) {
            PooledEffect effect = effects.get(i);
            effect.draw(batch, delta);
            if (effect.isComplete()) {
                effect.free();
                effects.removeIndex(i);
            }
        }
        batch.end();
    }

    private void clearScreen(Color color){
        Gdx.gl.glClearColor(color.r, color.g, color.b, color.a);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    }

    private void spawnParticleEffect(int x, int y){
        PooledEffect effect = touchEffectPool.obtain();
        effect.setPosition(x, Gdx.graphics.getHeight() - y);
        effects.add(effect);
    }

    @Override<commit_msg>Change background color in demo 1.2<commit_after>package com.udacity.gamedev.firstdemo;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool;
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.Array;

public class UdacityScreen extends InputAdapter implements Screen {

    SpriteBatch batch;
    Texture logo;
    ParticleEffectPool touchEffectPool;
    Array<PooledEffect> effects = new Array<PooledEffect>();

    private static final Color UDACITY_ORANGE = new Color(228.0f/225.0f, 127.0f/225.0f, 57.0f/225.0f, 1.0f);
    private static final Color UDACITY_BLUE = new Color(36.0f/225.0f, 73.0f/225.0f, 96.0f/225.0f, 1.0f);
    private static final float LOGO_WIDTH = 200.0f;
    private float logoHeight;

    @Override
    public void show() {
        batch = new SpriteBatch();
        logo = new Texture("udacity_logo_white.png");
        logoHeight = logo.getHeight() * LOGO_WIDTH/ logo.getWidth();

        ParticleEffect touchEffect = new ParticleEffect();
        touchEffect.load(Gdx.files.internal("UdacityEmitter.p"), Gdx.files.internal(""));
        touchEffect.setEmittersCleanUpBlendFunction(false);
        touchEffectPool = new ParticleEffectPool(touchEffect, 1, 2);
        Gdx.input.setInputProcessor(this);
    }

    @Override
    public void render(float delta) {
        // TODO: Make this UDACITY_BLUE instead
        clearScreen(UDACITY_BLUE);
        batch.begin();
        batch.draw(logo,
                (Gdx.graphics.getWidth() - LOGO_WIDTH)/2,
                (Gdx.graphics.getHeight() - logoHeight)/2,
                LOGO_WIDTH,
                logoHeight);
        for (int i = effects.size - 1; i >= 0; i--) {
            PooledEffect effect = effects.get(i);
            effect.draw(batch, delta);
            if (effect.isComplete()) {
                effect.free();
                effects.removeIndex(i);
            }
        }
        batch.end();
    }

    private void clearScreen(Color color){
        Gdx.gl.glClearColor(color.r, color.g, color.b, color.a);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    }

    private void spawnParticleEffect(int x, int y){
        PooledEffect effect = touchEffectPool.obtain();
        effect.setPosition(x, Gdx.graphics.getHeight() - y);
        effects.add(effect);
    }

    @Override
{'fraction_non_alphanumeric': 0.11541367585946355, 'fraction_numerical': 0.025311673592746504, 'mean_word_length': 2.784846318799142, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4269056', 'n_tokens_mistral': 1822, 'n_tokens_neox': 1697, 'n_words': 318}