Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ea.*;
- import java.awt.image.BufferedImage;
- import ea.internal.io.ImageLoader;
- import java.io.*;
- public class Figur
- {
- private int punkte;
- private int animation = 0;
- private int speed;
- private int stamina;
- public BufferedImage figurBil[] = new BufferedImage[12];
- //private int[] b ={1,2,3,4,5,6,7,8};
- public Figur()
- {
- punkte = 0;
- speed = 4;
- stamina = 100;
- }
- public int getPunkte()
- {
- return punkte;
- }
- public void setPunkte()
- {
- punkte = punkte + 1;
- }
- public int berechneAnimation(int r)
- {
- if(animation == 0)
- {
- animation = 1;
- return r - 2;
- }
- else if(animation == 1)
- {
- animation = 2;
- return r - 1;
- }
- else if(animation == 2)
- {
- animation = 3;
- return r;
- }
- else
- {
- animation = 0;
- return r - 1;
- }
- }
- public void setSpeed(int pSpeed){
- speed = pSpeed;
- }
- public void setStamina(int pStamina){
- stamina = stamina+pStamina;
- }
- public int getSpeed(){
- return speed;
- }
- public int getStamina(){
- return stamina;
- }
- public void ladeFiguren(int typ){
- for(int i =0; i < figurBil.length; i++)
- {
- figurBil[i] = ImageLoader.loadExternalImage("sprite/" + typ + "/" + (i+1) + ".png");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement