Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Cant get Message to appear
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
colinlamm




PostPosted: Tue Dec 20, 2011 7:35 pm   Post subject: Cant get Message to appear

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
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Dec 20, 2011 7:46 pm   Post subject: RE:Cant get Message to appear

Well that's a wall of code that I'm not going to read past 2 lines, though that is enough to address your issue.

You are obviously copy-pasting some parts of code from somewhere else. What does
code:

setscreen ("graphics:800;600")
View.Set ("offscreenonly")

do?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Aange10




PostPosted: Tue Dec 20, 2011 8:11 pm   Post subject: RE:Cant get Message to appear

I thought you learned about procedures lol.
colinlamm




PostPosted: Tue Dec 20, 2011 8:40 pm   Post subject: Re: RE:Cant get Message to appear

Aange10 @ Tue Dec 20, 2011 8:11 pm wrote:
I thought you learned about procedures lol.

Dont procedures basically allows u to copy whatever u put in the procedure in another place so that u dont have to copy all the things again? Like instead of copy and pasting a whole bunch of coding a bunch of times, i just put that coding in a procedure (random name) and whenever i wanna use that code again i just gotta write (random name)? o_O
colinlamm




PostPosted: Tue Dec 20, 2011 8:42 pm   Post subject: Re: RE:Cant get Message to appear

Tony @ Tue Dec 20, 2011 7:46 pm wrote:
Well that's a wall of code that I'm not going to read past 2 lines, though that is enough to address your issue.

You are obviously copy-pasting some parts of code from somewhere else. What does
code:

setscreen ("graphics:800;600")
View.Set ("offscreenonly")

do?


Im pretty sure the setscreen ("graphics:800;600") sets the run screen to a resolution of 800 by 600 and View.Set basically makes the animation better? (at least thats what i was told by my teacher)
colinlamm




PostPosted: Tue Dec 20, 2011 8:44 pm   Post subject: Re: Cant get Message to appear

The things i copied was the snow code, and the house :3 i did the rest by myself which makes me happy ^^
ProgrammingFun




PostPosted: Tue Dec 20, 2011 8:46 pm   Post subject: Re: Cant get Message to appear

colinlamm @ Tue Dec 20, 2011 8:44 pm wrote:
The things i copied was the snow code, and the house :3 i did the rest by myself which makes me happy ^^

Doing it all yourself will make you more happy Wink

Anyways, you are essentially telling the program to output graphics and then telling it now to in those two lines.
setscreen and View.Set are the same thing essentially.
Tony




PostPosted: Tue Dec 20, 2011 8:49 pm   Post subject: Re: RE:Cant get Message to appear

colinlamm @ Tue Dec 20, 2011 8:42 pm wrote:
View.Set basically makes the animation better? (at least thats what i was told by my teacher)

Kind of... it makes animations better by not making drawings appear on screen until later.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
colinlamm




PostPosted: Tue Dec 20, 2011 8:50 pm   Post subject: Re: Cant get Message to appear

ProgrammingFun @ Tue Dec 20, 2011 8:46 pm wrote:
colinlamm @ Tue Dec 20, 2011 8:44 pm wrote:
The things i copied was the snow code, and the house :3 i did the rest by myself which makes me happy ^^

Doing it all yourself will make you more happy Wink

Anyways, you are essentially telling the program to output graphics and then telling it now to in those two lines.
setscreen and View.Set are the same thing essentially.


O_o any ideas on how to get the "MERRY CHRISTMAS" thingy to appear? Razz
Aange10




PostPosted: Tue Dec 20, 2011 8:53 pm   Post subject: Re: RE:Cant get Message to appear

Tony @ 20/12/2011, 7:49 pm wrote:
colinlamm @ Tue Dec 20, 2011 8:42 pm wrote:
View.Set basically makes the animation better? (at least thats what i was told by my teacher)

Kind of... it makes animations better by not making drawings appear on screen until later.



View.Set doesn't do this. View.Set ("offscreenonly") does. View.Set and setscreen are synonymous, meaning both of them will do the same thing

code:

View.Set ("offscreenonly")
setscreen ("offscreenonly")


Both will set the screen to "offscreenonly"
colinlamm




PostPosted: Tue Dec 20, 2011 9:05 pm   Post subject: Re: Cant get Message to appear

ANYWAYS... So my friend told me that instead he did a put "SKDHASOIFHA" kinda thing, and used a delay. Using put makes the font ugly, so is it possible to make the letters appear one at a time for this code? Cus i made it in a new document and it worked fine on that, but when i added it to this code it got all slow o_o
Aange10




PostPosted: Tue Dec 20, 2011 10:01 pm   Post subject: RE:Cant get Message to appear

Quote:
ANYWAYS...


Everything being said is something you should learn from.
crossley7




PostPosted: Tue Dec 20, 2011 10:29 pm   Post subject: RE:Cant get Message to appear

What your issue is, is that you are having the letters printed to a buffer and then when the code runs through View.Update, it displays everything on the screen and so your text all appears at the same time.

I am putting it bluntly so that you can see exactly what you need to fix. I have not looked at your code extensively, nor do I intend to as it is uglier than my code is and I never look at my programs after finishing them for fear of hurting my mind trying to understand them. (Something I am working to fix)

Now you should be able to at least test a few solutions and figure it out.

On a side note, does anyone know if OpenTuring allows a variable in the first parameter for Font.Draw? That is something that has always frustrated me about Turing graphics that you have to hard code in Font.Draw
Tony




PostPosted: Tue Dec 20, 2011 10:34 pm   Post subject: RE:Cant get Message to appear

@crossley7
code:

var variable : string := "lol wut?"
var font : int := Font.New("whatever:12")
Font.Draw(variable, 100, 100, font, black)


see documentation -- Font.Draw
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
colinlamm




PostPosted: Wed Dec 21, 2011 8:52 pm   Post subject: Re: Cant get Message to appear

Is it possible to do a View.Set ("offscreenonly") at the beginning and then at the end where it says "end loop" i can take it off?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: