Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hero myHero;
- void setup() {
- size(400,600);
- myHero = new Hero();
- }
- void draw() {
- background(255);
- myHero.run();
- }
- class Hero {
- //GLOBAL VARIABLES
- int x = 75;
- int y = 50;
- //CONSTRUCTOR
- /* hero(int _x, int _y) {
- x = _x;
- y = _y;
- }
- */
- //FUNCTIONS
- void run() {
- display();
- }
- void display() {
- fill(0, 0, 255, 200);
- rectMode(CENTER);
- rect(mouseX, 570, x, y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement