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

Username:   Password: 
 RegisterRegister   
 Cant get envelope moving in next scene for pixel graphics
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
colinlamm




PostPosted: Sun Dec 18, 2011 4:14 pm   Post subject: Cant get envelope moving in next scene for pixel graphics

What is it you are trying to achieve?
Hey guys, right now im trying to make my envelope move when i change scenes. Heres the code for the envelope moving:

Turing:

var x2 : array 1..7 of int := init (846, 846, 878, 877,846, 859, 877)
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
  drawpolygon (x2, y2, 7, 1)
    for n : 1 .. 7
          x2 (n) := x2 (n) -counter
    end for
    if x2 (5) <= 650 then
        exit
    end if
    View.Update
    delay (1)
    cls ()




What is the problem you are having?
The problem im having is that when i get into the next scene, all i see is the snow moving, and the envelope doesnt appear :[





Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Here is my full code, which you will probably need. Any ideas on how to get it showing?

Turing:


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

var Box_y, Box_y2 : int %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
Box_y := 10
Box_y2 := 40

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 (100, 200, 410, 500)
var roofy : array 1 .. 4 of int := init (300, 450, 450, 300)


%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

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

        %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

        %House
        Draw.FillBox (20, 150, 250, 350, 111)           %House Square shape
        var x1 : array 1 .. 3 of int := init (20, 250, 140)   %House Roof
        var y1 : array 1 .. 3 of int := init (350, 350, 450) %House Roof
        Draw.FillPolygon (x1, y1, 3, 17) %Drawing Roof

        %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

        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, 255) % Head

        %Moving the Ipod Touch upwards
        if Box_y = 300 then
            exit
        end if
        Draw.FillBox (380, Box_y, 400, Box_y2, black) %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, 255) % 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, 255) % Head
        %Moving the Ipod Touch left after it moves upward
        if Box1 = 200 then
            exit
        end if
        Draw.FillBox (Box1, 290, Box2, 320, black)
        Draw.FillBox (350, 10, 450, 100, 90)
        Box1 := Box1 - 10
        Box2 := Box2 - 10
        View.Update
        delay (50)
        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

        %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

        %House
        Draw.FillBox (20, 150, 250, 350, 111)           %House Square shape
        var x1 : array 1 .. 3 of int := init (20, 250, 140)   %House Roof
        var y1 : array 1 .. 3 of int := init (350, 350, 450) %House Roof
        Draw.FillPolygon (x1, y1, 3, 17) %Drawing Roof

        %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
        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, 255) % Head
        Draw.FillBox (200, Box5, 220, Box6, black)
        if Box5 = 100 then
            exit
        end if
        Box5 := Box5 - 10
        Box6 := Box6 - 10

        View.Update
        delay (50)


        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

        %House
        Draw.FillBox (20, 150, 250, 350, 111)           %House Square shape
        var x1 : array 1 .. 3 of int := init (20, 250, 140)   %House Roof
        var y1 : array 1 .. 3 of int := init (350, 350, 450) %House Roof
        Draw.FillPolygon (x1, y1, 3, 17) %Drawing Roof

        %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.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
        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
        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

    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, 255) % Head


        %Sends text message to friend
        loop
            drawpolygon (x2, y2, 7, 1)
            for n : 1 .. 7
                x2 (n) := x2 (n) - counter
            end for
            if x2 (5) <= -100 then
                exit
            end if

            View.Update
            delay (1)
            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

            %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

            %House
            Draw.FillBox (20, 150, 250, 350, 111)       %House Square shape
            var x1 : array 1 .. 3 of int := init (20, 250, 140) %House Roof
            var y1 : array 1 .. 3 of int := init (350, 350, 450) %House Roof
            Draw.FillPolygon (x1, y1, 3, 17) %Drawing Roof

            %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.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
            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
            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

        % Friend recieves text message
        loop
            drawpolygon (x2, y2, 7, 1)
            for n : 1 .. 7
                x2 (n) := x2 (n) - counter
            end for
            if x2 (7) = 650 then
                exit
            end if
            View.Update
            delay (1)
            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
            drawfillbox (410, 300, 480, 500, black) %chimney
            drawline (410, 360, 480, 360, white) %horizontal line on the chimney
            drawline (410, 390, 480, 390, white) %horizontal line on the chimney
            drawline (410, 420, 480, 420, white) %horizontal line on the chimney
            drawline (410, 450, 480, 450, white) %horizontal line on the chimney
            drawline (410, 480, 480, 480, white) %horizontal line on the chimney
            drawline (445, 420, 445, 450, white) %vertical line on the chimney
            drawline (470, 390, 470, 420, white) %vertical line on the chimney
            drawline (470, 330, 470, 360, white) %vertical line on the chimney
            drawline (420, 480, 420, 450, white) %vertical line on the chimney
            drawline (470, 480, 470, 450, white) %vertical line on the chimney
            drawline (445, 500, 445, 480, white) %vertical line on the chimney

            Draw.FillPolygon (roofx, roofy, 4, red) %roof

            drawfillbox (120, 101, 480, 299, black) %house

            drawfillbox (350, 101, 460, 259, red) %door
            drawfillbox (385, 200, 425, 235, white) %window glass of the door
            drawbox (385, 200, 425, 235, black) %outline of the window on the door
            Draw.ThickLine (406, 232, 406, 202, 5, black) %blackline on the window
            Draw.ThickLine (388, 218, 423, 218, 5, black) %blackline on the window
            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
        end loop

        loop
            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
            drawfillbox (410, 300, 480, 500, black) %chimney
            drawline (410, 360, 480, 360, white) %horizontal line on the chimney
            drawline (410, 390, 480, 390, white) %horizontal line on the chimney
            drawline (410, 420, 480, 420, white) %horizontal line on the chimney
            drawline (410, 450, 480, 450, white) %horizontal line on the chimney
            drawline (410, 480, 480, 480, white) %horizontal line on the chimney
            drawline (445, 420, 445, 450, white) %vertical line on the chimney
            drawline (470, 390, 470, 420, white) %vertical line on the chimney
            drawline (470, 330, 470, 360, white) %vertical line on the chimney
            drawline (420, 480, 420, 450, white) %vertical line on the chimney
            drawline (470, 480, 470, 450, white) %vertical line on the chimney
            drawline (445, 500, 445, 480, white) %vertical line on the chimney

            Draw.FillPolygon (roofx, roofy, 4, red) %roof

            drawfillbox (120, 101, 480, 299, black) %house

            drawfillbox (350, 101, 460, 259, red) %door
            drawfillbox (385, 200, 425, 235, white) %window glass of the door
            drawbox (385, 200, 425, 235, black) %outline of the window on the door
            Draw.ThickLine (406, 232, 406, 202, 5, black) %blackline on the window
            Draw.ThickLine (388, 218, 423, 218, 5, black) %blackline on the window
            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, 255) % Head

           drawpolygon (x2, y2, 7, 1)
    for n : 1 .. 7
          x2 (n) := x2 (n) -counter
    end for
    if x2 (5) <= 650 then
        exit
    end if
    View.Update
    delay (1)
    cls ()
            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
    end loop
end loop



Please specify what version of Turing you are using
4.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Dec 18, 2011 4:47 pm   Post subject: Re: Cant get envelope moving in next scene for pixel graphics

colinlamm @ Sun Dec 18, 2011 4:14 pm wrote:
when i get into the next scene, all i see is the snow moving, and the envelope doesnt appear :[

Do you draw the envelope in the next scene as well?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
colinlamm




PostPosted: Sun Dec 18, 2011 6:09 pm   Post subject: Re: Cant get envelope moving in next scene for pixel graphics

Tony @ Sun Dec 18, 2011 4:47 pm wrote:
colinlamm @ Sun Dec 18, 2011 4:14 pm wrote:
when i get into the next scene, all i see is the snow moving, and the envelope doesnt appear :[

Do you draw the envelope in the next scene as well?


Yep the code for the next scene is here:
Turing:


  loop
            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
            timeRunning := Time.Elapsed
            locate (1, 1)
            put timeRunning
            drawfillbox (410, 300, 480, 500, black) %chimney
            drawline (410, 360, 480, 360, white) %horizontal line on the chimney
            drawline (410, 390, 480, 390, white) %horizontal line on the chimney
            drawline (410, 420, 480, 420, white) %horizontal line on the chimney
            drawline (410, 450, 480, 450, white) %horizontal line on the chimney
            drawline (410, 480, 480, 480, white) %horizontal line on the chimney
            drawline (445, 420, 445, 450, white) %vertical line on the chimney
            drawline (470, 390, 470, 420, white) %vertical line on the chimney
            drawline (470, 330, 470, 360, white) %vertical line on the chimney
            drawline (420, 480, 420, 450, white) %vertical line on the chimney
            drawline (470, 480, 470, 450, white) %vertical line on the chimney
            drawline (445, 500, 445, 480, white) %vertical line on the chimney

            Draw.FillPolygon (roofx, roofy, 4, red) %roof

            drawfillbox (120, 101, 480, 299, black) %house

            drawfillbox (350, 101, 460, 259, red) %door
            drawfillbox (385, 200, 425, 235, white) %window glass of the door
            drawbox (385, 200, 425, 235, black) %outline of the window on the door
            Draw.ThickLine (406, 232, 406, 202, 5, black) %blackline on the window
            Draw.ThickLine (388, 218, 423, 218, 5, black) %blackline on the window
            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, 255) % Head

           
            %Envelope moving to the person
            drawpolygon (x2, y2, 7, 1)
            for i : 1 .. 7
                x2 (i) := x2 (i) - 10
            end for
            if x2 (5) = 650 then
                exit
            end if
            View.Update
            delay (1)
            cls ()
           
           
            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

Aange10




PostPosted: Sun Dec 18, 2011 6:24 pm   Post subject: RE:Cant get envelope moving in next scene for pixel graphics

Reading to about line 300 of your code, your drawing the envelope off screen. You draw new things, but you never stop moving the envelop to the left. Try resetting it's position to the right side of the screen, so you can see it when it moves left.


Also, try reading about procedures in the Turing Walkthrough....
colinlamm




PostPosted: Mon Dec 19, 2011 9:25 pm   Post subject: Re: RE:Cant get envelope moving in next scene for pixel graphics

Aange10 @ Sun Dec 18, 2011 6:24 pm wrote:
Reading to about line 300 of your code, your drawing the envelope off screen. You draw new things, but you never stop moving the envelop to the left. Try resetting it's position to the right side of the screen, so you can see it when it moves left.


Also, try reading about procedures in the Turing Walkthrough....


Was the procedure because my code was sooo long? Anyways i used procedure and now my code is much shorter and neater. Thanks for recommending it Smile Anyways, OT i decided to change my scene so i wont be making an envelope appear
Aange10




PostPosted: Mon Dec 19, 2011 11:21 pm   Post subject: RE:Cant get envelope moving in next scene for pixel graphics

mainly

Quote:

neater


But, your problem before was that you were drawing your envelope off of the screen. The edge of the screen, 0, was when you switched to the next 'scene'. But you drew the scene in the same spot, but you let the envelop keep going to the left, past 0.

All you needed to do was reset the envelope's x position to maxx.
colinlamm




PostPosted: Tue Dec 20, 2011 7:39 pm   Post subject: Re: RE:Cant get envelope moving in next scene for pixel graphics

Aange10 @ Mon Dec 19, 2011 11:21 pm wrote:
mainly

Quote:

neater


But, your problem before was that you were drawing your envelope off of the screen. The edge of the screen, 0, was when you switched to the next 'scene'. But you drew the scene in the same spot, but you let the envelop keep going to the left, past 0.

All you needed to do was reset the envelope's x position to maxx.


Opps lol well anyways my next scene is much cooler. I need help with something though but i made another post for it :]
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 1  [ 7 Posts ]
Jump to:   


Style:  
Search: