What is it you are trying to achieve?
I am trying to show the message "Merry christmas" one letter at a time
What is the problem you are having?
the problem is, it doesnt show up! at the end, it just pauses and then ALL the letters show up, not one of them at a time.
Describe what you have tried to solve this problem
I made this code on a new window and it was fine, all the letters showed up 1 at a time, but when pasted it on this code, it didnt work.
Turing: |
%Name: Colin Lam 2011
%Class: ICS2O1-01 Seat #11
%Name of Program: pixel graphics
%Pixel graphics animation that involves wireless devices
%
% marking scheme Pixel assigment
% /10 mark for Initials Eg. GM
% /10 animation eg. snow, tree moving, snowman dancing
% /10 structures eg house, sled, stars, presents
% /10 comments
% /25 creativity(
% /10 storyboard
%Total out of ____ /65
setscreen ("graphics:800;600")
View.Set ("offscreenonly")
var x : array 1 .. 16 of int := init (599, 599, 641, 641, 714, 668, 695, 643, 671, 623, 573, 605, 547, 599, 527, 598)
var y : array 1 .. 16 of int := init (203, 156, 156, 202, 202, 248, 248, 298, 298, 346, 299, 299, 244, 244, 200, 203)
var font2 : int
font2 := Font.New ("Arial:12:bold,italic") %Font
assert font2 > 0
var font1 : int
font1 := Font.New ("TimesNewRoman:10:bold")
assert font1 > 0
var font3 : int
font3 := Font.New ("TimesNewRoman:6")
assert font3 > 0
var like : int := Pic.FileNew ("Facebook Like.JPG")
var Box_y, Box_y2, count2 : int := 0 %Moving the ipod touch Variables
var count : int := 0
var Box1 : int := 380
var Box2 : int := 400
var Box3 : int := 780
var Box4 : int := 800
var Box5 : int := 300
var Box6 : int := 325
var handx : int := 400
var handx2 : int := 550
var handy : int := 200
var handy2 : int := - 200
Box_y := 10
Box_y2 := 40
var x3 : array 1 .. 7 of int := init (746, 746, 778, 777, 746, 759, 777)
var y3 : array 1 .. 7 of int := init (155, 132, 132, 154, 154, 145, 154)
% This polygon was created using Gurjant Kalsi's Polygon Generator
var x2 : array 1 .. 7 of int := init (246, 246, 278, 277, 246, 259, 277)
var y2 : array 1 .. 7 of int := init (155, 132, 132, 154, 154, 145, 154)
% This polygon was created using Gurjant Kalsi's Polygon Generator
var counter : int := 1
var roofx : array 1 .. 4 of int := init (10, 150, 341, 450)
var roofy : array 1 .. 4 of int := init (300, 450, 450, 300)
var count1 : int := 1
%Snowflake Animation
const FlakesFalling := 400
var FlakeX : array 1 .. FlakesFalling of int
var FlakeY : array 1 .. FlakesFalling of int
for Flake : 1 .. FlakesFalling
FlakeX (Flake ) := Rand.Int (0, maxx)
FlakeY (Flake ) := Rand.Int (0, maxy)
end for
procedure decoration
Draw.FillBox (0, 200, 800, 600, 105) %Blue Sky Background
Draw.FillBox (0, 0, maxx, 199, 29) %Ground Background
drawfilloval (740, 550, 45, 45, grey) %moon
drawfilloval (710, 550, 30, 35, 105) %moon
%Initials
drawbox (785, 15, 745, 75, black) %second initial
drawbox (730, 15, 690, 75, black) %first initial
drawline (755, 20, 775, 20, black) %Second initial
drawline (755, 20, 755, 70, black) %Second initial
drawarc (715, 45, 20, 23, 75, 280, black) %First initial
drawfillbox (360, 250, 430, 450, black) %chimney
Draw.FillPolygon (roofx, roofy, 4, red) %roof
drawfillbox (70, 101, 430, 299, black) %house
drawfillbox (300, 101, 410, 259, red) %door
drawfillbox (335, 200, 375, 235, white) %window glass of the door
drawbox (335, 200, 375, 235, black) %outline of the window on the door
Draw.ThickLine (356, 232, 356, 202, 5, black) %blackline on the window
Draw.ThickLine (338, 218, 373, 218, 5, black) %blackline on the window
%Christmas Tree:
var x : array 1 .. 16 of int := init (599, 599, 641, 641, 714, 668, 695, 643, 671, 623, 573, 605, 547, 599, 527, 598)
var y : array 1 .. 16 of int := init (203, 156, 156, 202, 202, 248, 248, 298, 298, 346, 299, 299, 244, 244, 200, 203)
Draw.FillPolygon (x, y, 16, green)
% This polygon was created using Gurjant Kalsi's Polygon Generator
Draw.FillBox (650, 100, 750, 175, brightred) %Presents
Draw.ThickLine (700, 100, 700, 175, 5, brightgreen) %Presents
Draw.ThickLine (650, 140, 750, 140, 5, brightgreen) %Presents
Draw.FillBox (500, 100, 600, 175, brightgreen) %Presents
Draw.ThickLine (500, 140, 600, 140, 5, brightred) %Presents
Draw.ThickLine (550, 100, 550, 175, 5, brightred) %Presents
end decoration
loop
loop
count := count + 1
Draw.FillBox (0, 200, 800, 600, 105) %Blue Sky Background
Draw.FillBox (0, 0, maxx, 199, 29) %Ground Background
drawfilloval (740, 550, 45, 45, grey) %moon
drawfilloval (710, 550, 30, 35, 105) %moon
decoration
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
View.Update
delay (15)
Draw.Line (200, 1, 225, 50, 255) % Left Leg
Draw.Line (240, 1, 225, 50, 255) % Right Leg
Draw.Line (225, 50, 225, 100, 255) % Torso
Draw.Line (210, 75, 240, 100, 255) % Arms
Draw.FillOval (225, 125, 25, 25, white) % Head
%Moving the Ipod Touch upwards
if Box_y = 300 then
exit
end if
Draw.FillBox (380, Box_y, 400, Box_y2, 27) %Ipod Touch
Draw.FillBox (350, 10, 450, 100, 90)
Box_y := Box_y + 10
Box_y2 := Box_y2 + 10
View.Update
delay (50)
cls
Draw.Line (200, 1, 225, 50, 255) % Left Leg
Draw.Line (240, 1, 225, 50, 255) % Right Leg
Draw.Line (225, 50, 225, 100, 255) % Torso
Draw.Line (210, 75, 240, 100, 255) % Arms
Draw.FillOval (225, 125, 25, 25, white) % Head
end loop
loop
Draw.Line (200, 1, 225, 50, 255) % Left Leg
Draw.Line (240, 1, 225, 50, 255) % Right Leg
Draw.Line (225, 50, 225, 100, 255) % Torso
Draw.Line (210, 75, 240, 100, 255) % Arms
Draw.FillOval (225, 125, 25, 25, white) % Head
%Moving the Ipod Touch left after it moves upward
if Box1 = 200 then
exit
end if
Draw.FillBox (Box1, 290, Box2, 320, 27)
Draw.FillBox (350, 10, 450, 100, 90)
Box1 := Box1 - 10
Box2 := Box2 - 10
View.Update
delay (50)
cls
decoration
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
View.Update
delay (15)
end loop
%Moving the Ipod touch to person's hand
loop
Draw.Line (200, 1, 225, 50, 255) % Left Leg
Draw.Line (240, 1, 225, 50, 255) % Right Leg
Draw.Line (225, 50, 225, 100, 255) % Torso
Draw.Line (210, 75, 240, 100, 255) % Arms
Draw.FillOval (225, 125, 25, 25, white) % Head
Draw.FillBox (200, Box5, 220, Box6, 27)
if Box5 = 100 then
exit
end if
Box5 := Box5 - 10
Box6 := Box6 - 10
View.Update
delay (50)
Draw.Line (200, 1, 225, 50, 255) % Left Leg
Draw.Line (240, 1, 225, 50, 255) % Right Leg
Draw.Line (225, 50, 225, 100, 255) % Torso
Draw.Line (210, 75, 240, 100, 255) % Arms
Draw.FillOval (225, 125, 25, 25, 255) % Head
decoration
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
end loop
cls
Draw.FillBox (0, 200, 800, 600, 105) %Blue Sky Background
Draw.FillBox (0, 0, maxx, 199, 29) %Ground Background
drawfilloval (740, 550, 45, 45, grey) %moon
drawfilloval (710, 550, 30, 35, 105) %moon
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
%Christmas Tree:
Draw.FillPolygon (x, y, 16, green)
drawfillbox (205, 445, 600, 205, white) %screen
Draw.ThickLine (300, 230, 150, 0, 35, 91) %Draw hands of student using iPod
Draw.ThickLine (200, 450, 600, 450, 10, 28) %Outer frame
Draw.ThickLine (200, 200, 600, 200, 10, 28)
Draw.ThickLine (200, 450, 200, 200, 10, 28)
Draw.ThickLine (600, 450, 600, 200, 10, 28)
drawline (205, 415, 577, 415, 28) %Inner black frame
drawline (205, 390, 577, 390, 28)
Draw.ThickLine (205, 445, 595, 445, 10, black)
Draw.ThickLine (205, 205, 595, 205, 10, black)
Draw.ThickLine (205, 445, 205, 205, 10, black)
Draw.ThickLine (595, 445, 595, 205, 10, black)
drawfillbox (205, 445, 265, 205, black)
drawfillbox (589, 445, 545, 205, black)
drawoval (570, 320, 17, 17, white) %Draw home button
drawbox (564, 312, 578, 326, white)
drawfillbox (265, 445, 545, 420, blue)
Font.Draw ("Facebook", 360, 425, font2, white)
drawfillbox (360, 300, 460, 360, blue)
Font.Draw ("Login", 390, 330, font2, white)
drawarc (285, 417, 5, 4, 30, 150, brightblue) %Draw wifi sign
drawarc (285, 420, 10, 8, 30, 150, brightblue)
drawarc (285, 421, 20, 16, 30, 150, brightblue)
drawfillbox (510, 422, 533, 432, brightgreen) %Draw battery bar
drawbox (510, 422, 533, 432, gray)
drawbox (532, 425, 538, 430, gray)
drawfillbox (533, 425, 537, 429, brightgreen)
for Flake : 1 .. FlakesFalling
FlakeX (Flake ) := Rand.Int (0, maxx)
FlakeY (Flake ) := Rand.Int (0, maxy)
end for
decoration
Draw.Line (600, 1, 625, 50, 255) % Left Leg
Draw.Line (640, 1, 625, 50, 255) % Right Leg
Draw.Line (625, 50, 625, 100, 255) % Torso
Draw.Line (610, 75, 640, 100, 255) % Arms
Draw.FillOval (625, 125, 25, 25, white) % Head
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
decoration
Draw.ThickLine (300, 230, 150, 0, 35, 91) %Draw hands of student using iPod
Draw.ThickLine (200, 450, 600, 450, 10, 28) %Outer frame
Draw.ThickLine (200, 200, 600, 200, 10, 28)
Draw.ThickLine (200, 450, 200, 200, 10, 28)
Draw.ThickLine (600, 450, 600, 200, 10, 28)
drawline (205, 415, 577, 415, 28) %Inner black frame
drawline (205, 390, 577, 390, 28)
Draw.ThickLine (205, 445, 595, 445, 10, black)
Draw.ThickLine (205, 205, 595, 205, 10, black)
Draw.ThickLine (205, 445, 205, 205, 10, black)
Draw.ThickLine (595, 445, 595, 205, 10, black)
drawfillbox (205, 445, 265, 205, black)
drawfillbox (589, 445, 545, 205, black)
drawoval (570, 320, 17, 17, white) %Draw home button
drawbox (564, 312, 578, 326, white)
drawfillbox (265, 445, 545, 420, blue)
Font.Draw ("Facebook", 360, 425, font2, white)
drawfillbox (360, 300, 460, 360, blue)
Font.Draw ("Login", 390, 330, font2, white)
drawarc (285, 417, 5, 4, 30, 150, brightblue) %Draw wifi sign
drawarc (285, 420, 10, 8, 30, 150, brightblue)
drawarc (285, 421, 20, 16, 30, 150, brightblue)
drawfillbox (510, 422, 533, 432, brightgreen) %Draw battery bar
drawbox (510, 422, 533, 432, gray)
drawbox (532, 425, 538, 430, gray)
drawfillbox (533, 425, 537, 429, brightgreen)
loop
loop
exit when handx = 400
Draw.ThickLine (handx, handy, handx2, handy2, 35, 91) %Draw hands of student using ipod
handx := handx - 10
handx2 := handx2 - 10
decoration
drawfilloval (440, 180, 10, 10, white) %doorknob
Draw.Line (600, 1, 625, 50, 255) % Left Leg
Draw.Line (640, 1, 625, 50, 255) % Right Leg
Draw.Line (625, 50, 625, 100, 255) % Torso
Draw.Line (610, 75, 640, 100, 255) % Arms
Draw.FillOval (625, 125, 25, 25, white) % Head
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
drawfillbox (205, 445, 600, 205, white) %screen
decoration
Draw.ThickLine (300, 230, 150, 0, 35, 91) %Draw hands of student using iPod
Draw.ThickLine (200, 450, 600, 450, 10, 28) %Outer frame
Draw.ThickLine (200, 200, 600, 200, 10, 28)
Draw.ThickLine (200, 450, 200, 200, 10, 28)
Draw.ThickLine (600, 450, 600, 200, 10, 28)
drawline (205, 415, 577, 415, 28) %Inner black frame
drawline (205, 390, 577, 390, 28)
Draw.ThickLine (205, 445, 595, 445, 10, black)
Draw.ThickLine (205, 205, 595, 205, 10, black)
Draw.ThickLine (205, 445, 205, 205, 10, black)
Draw.ThickLine (595, 445, 595, 205, 10, black)
drawfillbox (205, 445, 265, 205, black)
drawfillbox (589, 445, 545, 205, black)
drawoval (570, 320, 17, 17, white) %Draw home button
drawbox (564, 312, 578, 326, white)
drawfillbox (265, 445, 545, 420, blue)
Font.Draw ("Facebook", 360, 425, font2, white)
drawfillbox (360, 300, 460, 360, blue)
Font.Draw ("Login", 390, 330, font2, white)
drawarc (285, 417, 5, 4, 30, 150, brightblue) %Draw wifi sign
drawarc (285, 420, 10, 8, 30, 150, brightblue)
drawarc (285, 421, 20, 16, 30, 150, brightblue)
drawfillbox (510, 422, 533, 432, brightgreen) %Draw battery bar
drawbox (510, 422, 533, 432, gray)
drawbox (532, 425, 538, 430, gray)
drawfillbox (533, 425, 537, 429, brightgreen)
end loop
exit when handy = 330
Draw.ThickLine (handx, handy, handx2, handy2, 35, 91)
handy := handy + 10
handy2 := handy2 + 10
delay (50)
View.Update
cls
decoration
Draw.Line (600, 1, 625, 50, 255) % Left Leg
Draw.Line (640, 1, 625, 50, 255) % Right Leg
Draw.Line (625, 50, 625, 100, 255) % Torso
Draw.Line (610, 75, 640, 100, 255) % Arms
Draw.FillOval (625, 125, 25, 25, white) % Head
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
decoration
drawfillbox (205, 445, 600, 205, white) %screen
Draw.ThickLine (300, 230, 150, 0, 35, 91) %Draw hands of student using iPod
Draw.ThickLine (200, 450, 600, 450, 10, 28) %Outer frame
Draw.ThickLine (200, 200, 600, 200, 10, 28)
Draw.ThickLine (200, 450, 200, 200, 10, 28)
Draw.ThickLine (600, 450, 600, 200, 10, 28)
drawline (205, 415, 577, 415, 28) %Inner black frame
drawline (205, 390, 577, 390, 28)
Draw.ThickLine (205, 445, 595, 445, 10, black)
Draw.ThickLine (205, 205, 595, 205, 10, black)
Draw.ThickLine (205, 445, 205, 205, 10, black)
Draw.ThickLine (595, 445, 595, 205, 10, black)
drawfillbox (205, 445, 265, 205, black)
drawfillbox (589, 445, 545, 205, black)
drawoval (570, 320, 17, 17, white) %Draw home button
drawbox (564, 312, 578, 326, white)
drawfillbox (265, 445, 545, 420, blue)
Font.Draw ("Facebook", 360, 425, font2, white)
drawfillbox (360, 300, 460, 360, blue)
Font.Draw ("Login", 390, 330, font2, white)
drawarc (285, 417, 5, 4, 30, 150, brightblue) %Draw wifi sign
drawarc (285, 420, 10, 8, 30, 150, brightblue)
drawarc (285, 421, 20, 16, 30, 150, brightblue)
drawfillbox (510, 422, 533, 432, brightgreen) %Draw battery bar
drawbox (510, 422, 533, 432, gray)
drawbox (532, 425, 538, 430, gray)
drawfillbox (533, 425, 537, 429, brightgreen)
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
end loop
Draw.ThickLine (handx, handy, handx2, handy2, 35, 91)
loop
decoration
Draw.ThickLine (200, 450, 600, 450, 10, 28) %Outer frame
Draw.ThickLine (200, 200, 600, 200, 10, 28)
Draw.ThickLine (200, 450, 200, 200, 10, 28)
Draw.ThickLine (600, 450, 600, 200, 10, 28)
drawfillbox (205, 445, 600, 205, white) %screen
drawline (205, 415, 577, 415, 28) %Inner black frame
drawline (205, 390, 577, 390, 28)
Font.Draw ("M", 270, 330, font2, black)
delay (100)
Font.Draw ("E", 284, 330, font2, black)
delay (100)
Font.Draw ("R", 295, 330, font2, black)
delay (100)
Font.Draw ("R", 307, 330, font2, black)
delay (100)
Font.Draw ("Y", 318, 330, font2, black)
delay (100)
Font.Draw ("C", 340, 330, font2, black)
delay (100)
Font.Draw ("H", 351, 330, font2, black)
delay (100)
Font.Draw ("R", 362, 330, font2, black)
delay (100)
Font.Draw ("I", 374, 330, font2, black)
delay (100)
Font.Draw ("S", 378, 330, font2, black)
delay (100)
Font.Draw ("T", 387, 330, font2, black)
delay (100)
Font.Draw ("M", 397, 330, font2, black)
delay (100)
Font.Draw ("A", 410, 330, font2, black)
delay (100)
Font.Draw ("S", 421, 330, font2, black)
delay (100)
Font.Draw ("E", 440, 330, font2, black)
delay (100)
Font.Draw ("V", 450, 330, font2, black)
delay (100)
Font.Draw ("E", 460, 330, font2, black)
delay (100)
Font.Draw ("R", 470, 330, font2, black)
delay (100)
Font.Draw ("Y", 482, 330, font2, black)
delay (100)
Font.Draw ("O", 492, 330, font2, black)
delay (100)
Font.Draw ("N", 503, 330, font2, black)
delay (100)
Font.Draw ("E", 514, 330, font2, black)
delay (100)
Font.Draw ("!", 524, 330, font2, black)
Font.Draw ("Like Comment Share", 270, 315, font1, blue)
Pic.Draw (like, 270, 250, 0)
Font.Draw ("Denny Chin", 295, 280, font1, blue)
Font.Draw ("Likes this", 370, 280, font1, black)
Draw.ThickLine (205, 445, 595, 445, 10, black)
Draw.ThickLine (205, 205, 595, 205, 10, black)
Draw.ThickLine (205, 445, 205, 205, 10, black)
Draw.ThickLine (595, 445, 595, 205, 10, black)
drawfillbox (205, 445, 265, 205, black)
drawfillbox (589, 445, 545, 205, black)
drawoval (570, 320, 17, 17, white) %Draw home button
drawbox (564, 312, 578, 326, white)
drawfillbox (265, 445, 545, 420, blue)
Font.Draw ("Facebook", 360, 425, font2, white)
Font.Draw ("Colin Lam", 270, 350, font1, blue)
Font.Draw ("December 25, 2011, 12:00 AM", 445, 315, font3, black) %Time
drawarc (285, 417, 5, 4, 30, 150, brightblue) %Draw wifi sign
drawarc (285, 420, 10, 8, 30, 150, brightblue)
drawarc (285, 421, 20, 16, 30, 150, brightblue)
drawfillbox (510, 422, 533, 432, brightgreen) %Draw battery bar
drawbox (510, 422, 533, 432, gray)
drawbox (532, 425, 538, 430, gray)
drawfillbox (533, 425, 537, 429, brightgreen)
for Flake : 1 .. FlakesFalling
%Drop The Flake
FlakeY (Flake ) - = Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if FlakeY (Flake ) < 0 then
FlakeY (Flake ) := maxy
FlakeY (Flake ) := Rand.Int (0, maxx)
end if
Draw.FillOval (FlakeX (Flake ), FlakeY (Flake ), 1, 1, white)
end for
count2 := count2 + 1
exit when count2 = 1
end loop
count2 := count2 + 1
exit when count2 = 2
end loop
|
Please specify what version of Turing you are using
4.1 |