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

Username:   Password: 
 RegisterRegister   
 Screen Saver
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
WhatAmIDoing




PostPosted: Thu Apr 29, 2004 8:54 am   Post subject: Screen Saver

This is my first screen saver. It is acyually screen saver format and everything. also is there any way to get rid of the title bar?? if so plz tell me i hate it.

var y, y2, x2, x, x3, y3, y4, x4, c, winID, mX1, mY1, mX, mY, button : int
winID := Window.Open ("title:Steve's Screensaver,graphics:780;520")
colorback (black)
cls
mousewhere (mX, mY, button)
mX1:=mX
mY1:=mY
%starting coordinates
y := 40
x := 40
x2 := maxx - 40
y2 := maxy - 40
y3 := maxy - 40
x3 := 40
y4 := 40
x4 := maxx - 40
%gets speed for each of the balls
var ySpeed, xSpeed : int := 10
var y2Speed, x2Speed : int := 10
var y3Speed, x3Speed : int := 10
var y4Speed, x4Speed : int := 10
%moves ball and bounces off side
loop
mousewhere (mX, mY, button)
%ball_1
if mX not= mX1 or mY not= mY1 or button = 1 then
Window.Close (winID)
exit
end if
randint (c, 1, 50)
if y >= maxy - 30 or y <= 30 then
ySpeed := -ySpeed
end if
if x >= maxx - 30 or x <= 30 then
xSpeed := -xSpeed
end if
y := y + ySpeed
x := x + xSpeed
drawfilloval (x, y, 30, 30, c)
delay (10)
drawfilloval (x, y, 30, 30, c)
%ball_2
if y2 >= maxy - 30 or y2 <= 30 then
y2Speed := -y2Speed
end if
if x2 >= maxx - 30 or x2 <= 30 then
x2Speed := -x2Speed
end if
y2 := y2 + y2Speed
x2 := x2 + x2Speed
drawfilloval (x2, y2, 30, 30, c)
delay (10)
drawfilloval (x2, y2, 30, 30, c)
%ball_3
if y3 >= maxy - 30 or y3 <= 30 then
y3Speed := -y3Speed
end if
if x3 >= maxx - 30 or x3 <= 30 then
x3Speed := -x3Speed
end if
y3 := y3 + y3Speed
x3 := x3 + x3Speed
drawfilloval (x3, y3, 30, 30, c)
delay (10)
drawfilloval (x3, y3, 30, 30, c)
%ball_4
if y4 >= maxy - 30 or y4 <= 30 then
y4Speed := -y4Speed
end if
if x4 >= maxx - 30 or x4 <= 30 then
x4Speed := -x4Speed
end if
y4 := y4 + y4Speed
x4 := x4 + x4Speed
drawfilloval (x4, y4, 30, 30, c)
delay (10)
drawfilloval (x4, y4, 30, 30, c)
end loop
Sponsor
Sponsor
Sponsor
sponsor
Raugrist




PostPosted: Thu Apr 29, 2004 9:36 am   Post subject: (No subject)

Well, you aren't using anything like View.Update which needs 4.0+, so you may as well go back to 3.1 and use the fullscreen.
Delta




PostPosted: Thu Apr 29, 2004 1:08 pm   Post subject: (No subject)

Well ya... if you want a screen saver... definately go back to OOT if your not gonna use any of the newer commands... or whatever... but ya... its not a screensaver at all :S.... and it constantly quits on me... I'm not sure why tho... it doesn't look like its supposed to :S does anyone else have this problem?
Raugrist




PostPosted: Thu Apr 29, 2004 2:24 pm   Post subject: (No subject)

Delta wrote:
and it constantly quits on me... I'm not sure why tho... it doesn't look like its supposed to :S does anyone else have this problem?

Well, did you move your mouse? Razz
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: