//package com.mycompany.app.mygroovymodule import processing.core.*; //--------------------------------------------------------- //--------------------------------------------------------- class SpriteEllipse { Float x = 0 Float y = 0 Float nRadius = 75 Integer color = 20; PApplet pApplet //--------------------------------------------------------- /* */ SpriteEllipse(PApplet pApplet) { this.pApplet = pApplet } //--------------------------------------------------------- /* */ SpriteEllipse(Float x, Float y, PApplet pApplet) { this.x = x this.y = y this.pApplet = pApplet } //--------------------------------------------------------- /* */ SpriteEllipse(Float x, Float y, Float r, Integer colorIn, PApplet pApplet) { this.x = x this.y = y this.nRadius = r this.color = colorIn this.pApplet = pApplet } //--------------------------------------------------------- /* Do any update actions. */ void update() { if (nRadius > 0) { nRadius-- } } //--------------------------------------------------------- /* Render/draw to the canvas/frame */ void render() { pApplet.stroke(0) pApplet.fill(color) pApplet.ellipse(x, y, nRadius, nRadius) } //--------------------------------------------------------- /* Returns status of if the sprite is dead or not. Dead meaning it is now useless for drawing purposes. @return true if sprite is dead or false if it is not dead. */ Boolean isDead() { if (nRadius <= 0) { return true } return false } }