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

Username:   Password: 
 RegisterRegister   
 need help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
new programmar




PostPosted: Sun Apr 11, 2004 9:04 pm   Post subject: need help

i am in grade 11 and i ahve to make 2 screen saver for assigment and i am really suck in programming. For example if you have 5 pic and i wnat that if one picture move and then other one come like one disapear adn then the second come, then third and then first one come again untill the user move mouse or press any key.
plz help me and i am faling the course
Sponsor
Sponsor
Sponsor
sponsor
gamer




PostPosted: Sun Apr 11, 2004 9:31 pm   Post subject: (No subject)

ya need ta be more specific
btw the purpose of this forum is not to help others like u to do hwk for them.... especially when u ar in gr11, u should be able to program simple things like this
Paul




PostPosted: Sun Apr 11, 2004 9:56 pm   Post subject: (No subject)

hm.. I know how u feel, I have friends who are failing. Though I dunno how to make a screen saver work in windows, I know how to make pictures move like you described. And since I forgot how to put pics in an array I'll just write it out the long way:
This should work, I typed it out in 10 min, theres prolly an easier way to do it, but Im grade 10. I also didn't add the keyboard function, but that should be easy, just exit when a key has been pressed. Though I set out to help you I couldn't help giving out the whole code, cause I was interested in it as well, never made something like this :p hope it helps you. You'll have to use the search button at the top to find out how to turn programs into screen savers.
code:

var pic: array 1..5 of int
var x, ex: int:=0
var mousex, mousey, btn, oldx, oldy: int
var keyboard: array char of boolean
pic(1):=Pic.FileNew ("picname.jpg")
pic(2):=Pic.FileNew ("picname2.jpg")
pic(3):=Pic.FileNew ("picname3.jpg")
pic(4):=Pic.FileNew ("picname4.jpg")
pic(5):=Pic.FileNew ("picname5.jpg")
Mouse.Where (oldx, oldy, btn)
loop
for a: 1..5
loop
 Pic.Draw (pic(a), x, maxy div 2 - 50, picCopy)
x+=1
if x>= maxx then
x:=0
exit
end if
Mouse.Where (mousex, mousey, btn)
if btn=1 or mousex not = oldx or mousey not= oldy then
ex=1
exit
end if
end loop
if ex:=1 then
exit
end if
end for
if ex= 1 then
exit
end if
end loop
the_short1




PostPosted: Sun Apr 18, 2004 4:35 pm   Post subject: (No subject)

hey paul... even though this is a bad topic... i will tell u...
to put pics in a array (MAN I LOVE THIS!**i made a MSN emotion screensaver and it had 100 Pictures) this made it realy easy...

code:

var pics : array 1..100 of int
for a :  1.. 100
pics (a) := Pic.FileNew ("pic"+intstr(a)+".bmp")
end for


that loads 100 pictures called pic1-100.bmp

Wink Smile


dude making this topic.... ... making a screensaver is easy... dont lie to us and try to make us make programs for u... thats not cool...
AsianSensation




PostPosted: Sun Apr 18, 2004 5:02 pm   Post subject: (No subject)

the_short1 wrote:

code:

var pics : array 1..100 of int
for a :  1.. 100
pics (a) := Pic.FileNew ("pic"+intstr(a)+".bmp")
end for


Of course it does, that's why it was in the Tidbits and Tricks for programming.
the_short1




PostPosted: Mon Apr 19, 2004 6:44 am   Post subject: (No subject)

wha.???? i dont know about no tibits and tricks in programming ......where was that posted.......

i just saw a prgram that used intstr then i reseearched it.... then Idea poped up itnto my head to make pictures load that way.. Smile
Cervantes




PostPosted: Mon Apr 19, 2004 3:39 pm   Post subject: (No subject)

Tidbits and Tricks

Its in Turing Tutorials.
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: