need help
Author |
Message |
new programmar
|
Posted: 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
|
|
|
gamer
|
Posted: 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
|
Posted: 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
|
|
|
|
|
AsianSensation
|
Posted: 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
|
Posted: 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 poped up itnto my head to make pictures load that way.. |
|
|
|
|
|
Cervantes
|
Posted: Mon Apr 19, 2004 3:39 pm Post subject: (No subject) |
|
|
Tidbits and Tricks
Its in Turing Tutorials. |
|
|
|
|
|
|
|