Advertisement
Guest User

Figur

a guest
Feb 2nd, 2017
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. import ea.*;
  2. import java.awt.image.BufferedImage;
  3. import ea.internal.io.ImageLoader;
  4. import java.io.*;
  5.  
  6. public class Figur
  7. {
  8. private int punkte;
  9. private int animation = 0;
  10. private int speed;
  11. private int stamina;
  12.  
  13. public BufferedImage figurBil[] = new BufferedImage[12];
  14.  
  15. //private int[] b ={1,2,3,4,5,6,7,8};
  16.  
  17. public Figur()
  18. {
  19. punkte = 0;
  20. speed = 4;
  21. stamina = 100;
  22. }
  23.  
  24. public int getPunkte()
  25. {
  26. return punkte;
  27. }
  28.  
  29. public void setPunkte()
  30. {
  31. punkte = punkte + 1;
  32. }
  33.  
  34. public int berechneAnimation(int r)
  35. {
  36. if(animation == 0)
  37. {
  38. animation = 1;
  39. return r - 2;
  40. }
  41. else if(animation == 1)
  42. {
  43. animation = 2;
  44. return r - 1;
  45. }
  46. else if(animation == 2)
  47. {
  48. animation = 3;
  49. return r;
  50. }
  51. else
  52. {
  53. animation = 0;
  54. return r - 1;
  55. }
  56. }
  57.  
  58. public void setSpeed(int pSpeed){
  59. speed = pSpeed;
  60. }
  61.  
  62. public void setStamina(int pStamina){
  63. stamina = stamina+pStamina;
  64. }
  65.  
  66. public int getSpeed(){
  67. return speed;
  68. }
  69.  
  70. public int getStamina(){
  71. return stamina;
  72. }
  73.  
  74. public void ladeFiguren(int typ){
  75. for(int i =0; i < figurBil.length; i++)
  76. {
  77. figurBil[i] = ImageLoader.loadExternalImage("sprite/" + typ + "/" + (i+1) + ".png");
  78. }
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement