- Joined
- Oct 24, 2022
- Messages
- 1
- Reaction score
- 0
var gameChar_x = 0;
var gameChar_y = 0;
function setup()
{
createCanvas(400, 600);
}
function draw()
{
background(255);
//Standing, facing frontwards
stroke(100);
noFill();
rect(20, 60, 50, 80);
noStroke();
fill(0);
text("1. standing front facing", 20, 160);
gameChar_x = 45;
gameChar_y = 137;
//Body
fill (255,220,0);
ellipse (gameChar_x,gameChar_y-35,45,50)
//legs
fill (0,0,255)
rect (gameChar_x-15,gameChar_y-32,35,39,15)
//arms
fill (0,0,255)
rect (gameChar_x-25,gameChar_y-20,33,5)
rotate
rect (gameChar_x-0, gameChar_y-20,30,5)
//eyes
fill(255,255,255)
ellipse (gameChar_x-16,gameChar_y-47,10,15)
ellipse (gameChar_x-1,gameChar_y-47,10,15)
fill (0,0,0)
ellipse (gameChar_x-12,gameChar_y-47,5,7)
ellipse (gameChar_x-1,gameChar_y-47,5,5)
//Add your code here ...
//Jumping facing forwards
stroke(100);
noFill();
rect(220, 60, 50, 80);
noStroke();
fill(0);
text("2. jumping facing forwards", 220, 160);
gameChar_x = 245;
gameChar_y = 137;
//Add your code here ...
//Body
fill (255,220,0);
ellipse (gameChar_x,gameChar_y-35,45,50)
//arms
fill (0,0,255)
rect (gameChar_x-25,gameChar_y-20,33,5)
rect (gameChar_x-0, gameChar_y-20,30,5)
//legs
fill (0,0,255)
rect (gameChar_x-15,gameChar_y-32,35,39,15,15)
//eyes
fill(255,255,255)
ellipse (gameChar_x-16,gameChar_y-47,10,15)
ellipse (gameChar_x-1,gameChar_y-47,10,15)
fill (0,0,0)
ellipse (gameChar_x-12,gameChar_y-47,5,7)
ellipse (gameChar_x-1,gameChar_y-47,5,5)
//Walking, turned left
stroke(100);
noFill();
rect(20, 260, 50, 80);
noStroke();
fill(0);
text("3. Walking left", 20, 360);
gameChar_x = 45;
gameChar_y = 337;
//Add your code here ...
//Walking, turned right
stroke(100);
noFill();
rect(220, 260, 50, 80);
noStroke();
fill(0);
text("4. Walking right", 220, 360);
gameChar_x = 245;
gameChar_y = 337;
//Add your code here ...
//Body
//Jumping right
stroke(100);
noFill();
rect(20, 460, 50, 80);
noStroke();
fill(0);
text("5. Jumping to the right", 20, 560);
gameChar_x = 45;
gameChar_y = 537;
//Add your code here ...
//Body
//Jumping to the left
stroke(100);
noFill();
rect(220, 460, 50, 80);
noStroke();
fill(0);
text("6. Jumping to the left", 220, 560);
gameChar_x = 245;
gameChar_y = 537;
//Add your code here ...
//Body
push();
fill(0);
noStroke();
text (mouseX+ ","+mouseY, mouseX,mouseY);
pop();
}
var gameChar_y = 0;
function setup()
{
createCanvas(400, 600);
}
function draw()
{
background(255);
//Standing, facing frontwards
stroke(100);
noFill();
rect(20, 60, 50, 80);
noStroke();
fill(0);
text("1. standing front facing", 20, 160);
gameChar_x = 45;
gameChar_y = 137;
//Body
fill (255,220,0);
ellipse (gameChar_x,gameChar_y-35,45,50)
//legs
fill (0,0,255)
rect (gameChar_x-15,gameChar_y-32,35,39,15)
//arms
fill (0,0,255)
rect (gameChar_x-25,gameChar_y-20,33,5)
rotate
rect (gameChar_x-0, gameChar_y-20,30,5)
//eyes
fill(255,255,255)
ellipse (gameChar_x-16,gameChar_y-47,10,15)
ellipse (gameChar_x-1,gameChar_y-47,10,15)
fill (0,0,0)
ellipse (gameChar_x-12,gameChar_y-47,5,7)
ellipse (gameChar_x-1,gameChar_y-47,5,5)
//Add your code here ...
//Jumping facing forwards
stroke(100);
noFill();
rect(220, 60, 50, 80);
noStroke();
fill(0);
text("2. jumping facing forwards", 220, 160);
gameChar_x = 245;
gameChar_y = 137;
//Add your code here ...
//Body
fill (255,220,0);
ellipse (gameChar_x,gameChar_y-35,45,50)
//arms
fill (0,0,255)
rect (gameChar_x-25,gameChar_y-20,33,5)
rect (gameChar_x-0, gameChar_y-20,30,5)
//legs
fill (0,0,255)
rect (gameChar_x-15,gameChar_y-32,35,39,15,15)
//eyes
fill(255,255,255)
ellipse (gameChar_x-16,gameChar_y-47,10,15)
ellipse (gameChar_x-1,gameChar_y-47,10,15)
fill (0,0,0)
ellipse (gameChar_x-12,gameChar_y-47,5,7)
ellipse (gameChar_x-1,gameChar_y-47,5,5)
//Walking, turned left
stroke(100);
noFill();
rect(20, 260, 50, 80);
noStroke();
fill(0);
text("3. Walking left", 20, 360);
gameChar_x = 45;
gameChar_y = 337;
//Add your code here ...
//Walking, turned right
stroke(100);
noFill();
rect(220, 260, 50, 80);
noStroke();
fill(0);
text("4. Walking right", 220, 360);
gameChar_x = 245;
gameChar_y = 337;
//Add your code here ...
//Body
//Jumping right
stroke(100);
noFill();
rect(20, 460, 50, 80);
noStroke();
fill(0);
text("5. Jumping to the right", 20, 560);
gameChar_x = 45;
gameChar_y = 537;
//Add your code here ...
//Body
//Jumping to the left
stroke(100);
noFill();
rect(220, 460, 50, 80);
noStroke();
fill(0);
text("6. Jumping to the left", 220, 560);
gameChar_x = 245;
gameChar_y = 537;
//Add your code here ...
//Body
push();
fill(0);
noStroke();
text (mouseX+ ","+mouseY, mouseX,mouseY);
pop();
}