xxxxxxxxxx
let fatty;
function preload()
{
fatty = createSprite(850, 850, 100, 100);
let fattyAnimation = fatty.addAnimation('fatty','New_Piskel-1png-1png.png','New_Piskel-2png-1png.png');
fattyAnimation.frameDelay = 30; // How long until switching animations
}
let circleX; // x coordinate of a ball/circle
let velocityX; // x velocity of the ball in pixels per frame
let diameter; // diameter of the ball
let circleY
function setup() {
createCanvas(windowWidth, windowHeight);
background(0)
noStroke();
circleX = 10;
diameter = 50;
velocityX = 5;
velocityY = 5;
circleY = 10;
fatty.velocity.x=17
}
function draw() {
//ellipse(mouseX, mouseY, 20, 20);
background(0)
if(fatty.position.x > windowWidth)
{
fatty.velocity.x=fatty.velocity.x*-1
}
{
if (fatty.position.x < 0)
fatty.velocity.x = fatty.velocity.x * -1.1;
if (circleY > windowHeight)
// Make velocity negative
velocityY = velocityY * -1.1;
drawSprites();}
}