xxxxxxxxxx
118
class Redplayer{
constructor(x,y,r,w){
this.x = x;
this.y = y;
this.r = r;
this.w = w;
}
display(){
stroke(0)
fill(255,0,0)
rect(this.x,this.y,this.r,this.w)
}
Nlight(){
noStroke()
fill('hotpink')
if(rmotion > 0){
rect(x + 35,y + 17.5,35,35)
}
if(rmotion < 0){
rect(x - 35, y + 17.5,35,35)
}
}
Slight(){
noStroke()
fill('hotpink')
if(rmotion > 0){
rect(x + 35, y + 22.5,40 ,25 )
x = x + 8
}
if(rmotion < 0){
rect(x - 35, y + 22.5,40,25)
x = x - 8
}
}
Dlight(){
noStroke()
fill('hotpink')
if(rmotion > 0){
rect(x + 35, y + 44.5, 40,25)
}
if(rmotion < 0){
rect(x - 40,y + 44.5, 40,25)
}
}
Nsig(){
noStroke()
fill('#ff6e00')
rect(x - 20, y - 29, 75,30)
}
Ssig(){
yvel = 0
if(rmotion > 0){
x = x + 30
}
if(rmotion < 0){
x = x - 30
}
noStroke()
fill('#ff6e00')
rect(x, y, 35,70)
}
Dsig(){
noStroke()
fill('#ff6e00')
if(rmotion > 0){
rect(x + 35, rising, 35,70 - risr)
}
if(rmotion < 0){
rect(x - 35, rising, 35, 70 - risr)
}
}
Usig(){
noStroke()
fill('#ff6e00')
rect(x, y, 35,70)
yvel = -12
}
}