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

Username:   Password: 
 RegisterRegister   
 bouncy ball program: try to make it cool
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
skilly




PostPosted: Tue Jan 15, 2008 12:21 pm   Post subject: bouncy ball program: try to make it cool

Make changes to this program and try to make it look cooler and then paste it so I can check it out.

code:

View.Set ("graphics:max;max;noecho")
var x, y: int := 10
var xChange, yChange : int := 3
Draw.Fill (100, 100, black, 2)
loop
    Draw.FillOval (x, y, 10, 10, white)
     Time.Delay (3)
    x += xChange
    y += yChange
    if x < 10 or x > maxx - 10 then
        xChange := -xChange
    end if
    if y < 10 or y > maxy - 10 then
        yChange := -yChange
    end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
StealthArcher




PostPosted: Tue Jan 15, 2008 1:35 pm   Post subject: RE:bouncy ball program: try to make it cool

Ummmm, no.
petree08




PostPosted: Tue Jan 15, 2008 2:36 pm   Post subject: RE:bouncy ball program: try to make it cool

i agree, no,
i'm pretty sure we've seen this a million times
ericfourfour




PostPosted: Tue Jan 15, 2008 4:37 pm   Post subject: RE:bouncy ball program: try to make it cool

code:

StealthArcher




PostPosted: Tue Jan 15, 2008 4:57 pm   Post subject: RE:bouncy ball program: try to make it cool

First off try this, it looks like a ball instead of a worm,
code:

View.Set("graphics:max;max;noecho,offscreenonly")
var x, y: int := 10
var xChange, yChange : int := 3
loop
    cls
    Draw.FillOval (x, y, 10, 10, black)
    View.Update
    x += xChange
    y += yChange
    if x < 10 or x > maxx - 10 then
        xChange := -xChange
    end if
    if y < 10 or y > maxy - 10 then
        yChange := -yChange
    end if
end loop


Oh and offscreenonly, and View.Update make things prettier, now, I've shown some fundamentals, go make it cooler, and post it here so we can check it out.
adigamov




PostPosted: Tue Jan 22, 2008 12:15 am   Post subject: Re: bouncy ball program: try to make it cool

Quote:

View.Set ("graphics:max;max;noecho")
var x, y : int := 10
var xChange, yChange : int := 3
Draw.Fill (100, 100, black, 2)
var z : int := 0

loop
Draw.FillOval (x, y, 10, 10, z)
Time.Delay (3)
x += xChange
y += yChange
if x < 10 or x > maxx - 10 then
xChange := -xChange
z := z + 1
end if
if y < 10 or y > maxy - 10 then
yChange := -yChange
z := z + 1
end if
end loop

lol
now it changes colour whenever it makes contact to a wall
TokenHerbz




PostPosted: Tue Jan 22, 2008 8:30 pm   Post subject: RE:bouncy ball program: try to make it cool

just change your original post a bit, have in instead it drawing white enter " Rand.Int(1,250) "
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  [ 7 Posts ]
Jump to:   


Style:  
Search: