Advertisement
Ramdan51-062

Cherry

Dec 14th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. package Snake;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Graphics;
  5. import java.awt.Point;
  6. import java.util.Random;
  7.  
  8. public class Cherry {
  9.     public Random random;
  10.     public int x, y;
  11.     public Point cherry;
  12.     public Snake snake;
  13.  
  14.     public Cherry(int x, int y) {
  15.         this.x = x;
  16.         this.y = y;
  17.         cherry = new Point(x, y);
  18.     }
  19.  
  20.     public void render(Graphics g) {
  21.         g.setColor(Color.WHITE);
  22.         g.fillRect(cherry.x * Snake.SCALE, cherry.y * Snake.SCALE, Snake.SCALE, Snake.SCALE);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement