clear()

def stickydown() {

    setPenColor(blue)

    setPenThickness(7)

    right(360, 20)

    right(180)

    setPosition(20,-20)

    right(180)

    savePosHe()

    right(135)

    forward(50)

    right(70)

    forward(40)

    restorePosHe()

    savePosHe()

    left(130)

    forward(50)

    left(105)

    forward(70)

    restorePosHe()

    right(180)

    savePosHe()

    forward(60)

    savePosHe()

    left(15)

    forward(85)

    restorePosHe()

    right(15)

    forward(85)

}

def stickyright() {

    setPenColor(blue)

    setPenThickness(7)

    right(360, 20)

    right(180)

    setPosition(20,-20)

    right(180)

    savePosHe()

    right(135)

    forward(50)

    right(20)

    forward(60)

    restorePosHe()

    savePosHe()

    left(165)

    forward(50)

    left(80)

    forward(85)

    restorePosHe()

    right(180)

    savePosHe()

    forward(90)

    savePosHe()

    left(55)

    forward(125)

    restorePosHe()

    right(15)

    forward(70)

}

def stickyball() {

    setPenColor(purple)

    setPenThickness(7)

    right(360, 20)

    right(180)

    setPosition(20,-20)

    right(180)

    savePosHe()

    right(135)

    forward(45)

    restorePosHe()

    savePosHe()

    left(50)

    forward(45)

    restorePosHe()

    right(180)

    savePosHe()

    forward(40)

    savePosHe()

    left(15)

    forward(45)

    restorePosHe()

    right(15)

    forward(45)

}

def bat(){

    setFillColor(brown)

    setPenColor(brown)

    forward(60)

    right(30)

    forward(15)

    left(30)

    forward(25)

    right()

    forward(5)

    right()

    forward(25)

    left(30)

    forward(15)

    right(30)

    forward(60)

    right()

    forward(20)

}

def ball (){

    setFillColor(red)

    setPenColor(red)

    right(360, 7)

}

setSpeed(fast)

setBackground(green)

setPosition(-550,-107)

setFillColor(yellow)

    setPenColor(yellow)

    repeat(2){

        forward(5)

        right()

        forward(620)

        right()

    }

setPosition(-520,-107)

setFillColor(white)

setPenColor(white)

    repeat(2){

        forward(70)

        right()

        forward(6)

        right()

    }

setPosition(30,-107)

setFillColor(white)

    setPenColor(white)

    repeat(2){

        forward(70)

        right()

        forward(6)

        right()

    }

setPosition(-2000,400)

setPenColor(white)

    setPenColor(white)

    repeat(2){

        forward(130)

        right()

        forward(5000)

        right()

    }

setPosition(-600,530)

setPenColor(blue)

write(” Coca Cola Pepsi”)

val ball1 = Picture{ ball() }

draw(ball1)

val bat1 = Picture{ bat() }

bat1.setPosition(-350,-105)

bat1.rotate(30)

val stickydown1 = Picture{ stickydown() }

stickydown1.setPosition(-423,65)

val stickyright1 = Picture{ stickyright() }

stickyright1.setPosition(-465,75)

val stickyball1 = Picture { stickyball() }

draw(stickyball1)

stickyball1.setPosition(25,-8)

draw(stickydown1)

draw(bat1)

var x = 0

timer(100){

if (x < 30){

     ball1.translate(-6,-3)

     //stickyball1.invisible()

}

    if(x > 30){

        ball1.translate(-6,3)

    }

    if(x == 50){

        draw(stickyright1)

        stickydown1.invisible()

        bat1.rotate(60)

        bat1.setPosition(-295,-40)

    }

   if(x > 50) {

        ball1.translate(6,3)

       //stickyright1.invisible()

        //stickydown1.visible()

        //bat1.invisible()

   }

    x = x + 1

    }

    invisible()

Leave a Reply

Your email address will not be published. Required fields are marked *