Android Open Source - makipong Pala Actor






From Project

Back to project page makipong.

License

The source code is released under:

GNU General Public License

If you think the Android project makipong listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Makipong, just another Pong clone//www . j  ava2 s  .  c  o m
 * Copyright (C) 2013 Dani Rodrguez
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package tk.makigas.makipong;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Actor;

/**
 * La paleta es el elemento que se usa para golpear la bola.
 * 
 * @author danirod
 */
public class PalaActor extends Actor {
  
  /** Textura usada por la pala. */
  private Texture palaTex;

  public PalaActor() {
    palaTex = Makipong.MANAGER.get("paleta.png");
    
    // Ahora que tenemos la textura de la pala aprovechamos para cambiar
    // el tamao de este actor y hacer que coincida con el tamao de
    // la pala.
    setSize(palaTex.getWidth(), palaTex.getHeight());
  }
  
  @Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    batch.draw(palaTex, getX(), getY());
  }
  
}




Java Source Code List

tk.makigas.makipong.BolaActor.java
tk.makigas.makipong.MainActivity.java
tk.makigas.makipong.Main.java
tk.makigas.makipong.Makipong.java
tk.makigas.makipong.PalaActor.java
tk.makigas.makipong.PalaUserInput.java