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

Username:   Password: 
 RegisterRegister   
 bouncing stars
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cool dude




PostPosted: Fri Oct 08, 2004 2:44 pm   Post subject: bouncing stars

i made this when i was really!!! bored. it really sux and the stars keep flickering. if u have any suggestions please share otherwise heres the code

code:

setscreen("graphics:max;max")
View.Set ("offscreenonly")
color(yellow)
colorback(blue)
cls

var x : int :=  320   
var y : int := 350     
var xchange:int:=1
var ychange:int:=1



loop
cls

    x := x - xchange
    y := y + ychange
   
    drawfillstar (x, y, 100, 100, yellow)
    delay(5)   
   
   
    if x = 10 or x =630 then
        xchange:=xchange*-1
   
    end if
    if y = 10 or y = 390 then
        ychange :=ychange*-1
    end if

   
   

    x := x - xchange
    y := y + ychange
   
    drawfillstar (x, y, 300, 300, yellow)
    delay(5)   
   
   
    if x = 20 or x =710 then
        xchange:=xchange*-1
   
    end if
    if y = 20 or y = 400 then
        ychange :=ychange*-1
    end if
end loop

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Fri Oct 08, 2004 3:07 pm   Post subject: (No subject)

Where's the View.Update? Would be nice Confused
Also, if you want to encoporate the entire screen into the program, you could use the maxx and maxy functions.
also,
code:
color (yellow)

does not need to be there, since it only affects the colour of text (and that doesn't include Font.Draw or Draw.Text), and you don't have any text in your program.

Good work 8)
cool dude




PostPosted: Mon Nov 08, 2004 7:11 pm   Post subject: (No subject)

sorry i did this program just when i started learning turing. right now i am making much more complex programs. as well i did have the View.Update there before but when i posted it, it got erased somehow.
cool dude




PostPosted: Mon Nov 08, 2004 7:13 pm   Post subject: (No subject)

if anybody wants to see this program then just put a View.Update right before delay (5) line 22.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: