
-----------------------------------
cool dude
Fri Oct 08, 2004 2:44 pm

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


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 



-----------------------------------
Cervantes
Fri Oct 08, 2004 3:07 pm


-----------------------------------
Where's the View.Update?  Would be nice :?
Also, if you want to encoporate the entire screen into the program, you could use the maxx and maxy functions.
also, 
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
Mon Nov 08, 2004 7:11 pm


-----------------------------------
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
Mon Nov 08, 2004 7:13 pm


-----------------------------------
if anybody wants to see this program then just put a View.Update right before delay (5) line 22.
