So i'm making a game of visual rock paper scissors, essentially i scanned in a bunch of hand drawn pictures and was going to use them to illustrate my game. I input the drawn pictures using the Load Image command, and then attempted to put some hidden sprites in there on my pictures around areas your supposed to be able to click. my problem is, when i want to change the background, it doesn't seem to get rid of the hidden sprites, so you can still click them and they continually layer on there.. I need to figure out where/how i can upload all my pictures so maybe anyone/everyone could run it and see what issues i'm having. Also my random number generator isn't working either, it always returns a value of 3, and its driving me nuts.. I'm open to any and all suggestions, i'll post the code and try to add the pictures once i get a chance later on tonight.
If anyone could help with my randomized numbers or give any overall suggestions on where it looks like i've gone wrong, i'm more then happy to give any ideas a shot cause i'm completely out of ideas.
Also i'm relatively new to DBPro, so theres alot i'm unaware of.
sync on
sync rate 30
load image "start.bmp", 4
load image "startsprite1.bmp", 5
load image "clicksprite.bmp", 6
load image "rock.bmp", 7
load image "warrior.bmp",8
load image "chooserock.bmp", 9
load image "win.bmp", 10
load image "continue.bmp", 11
load image "endsprite1.bmp", 12
load image "choosepaper.bmp", 13
load image "choosescissors.bmp", 14
load image "tie.bmp", 15
load image "rockvspaper.bmp", 16
load image "rockvsscissors.bmp", 17
load image "papervsrock.bmp", 18
load image "papervsscissors.bmp", 19
load image "scissorsvspaper.bmp", 20
load image "scissorsvsrock.bmp", 21
computer=rnd(2)+1
do
paste image 4, 0, 0
sprite 1, 140, 200, 5
hide sprite 1
sprite 2, 185, 320, 12
hide sprite 2
`if mouse is clicked, test for sprite collision
if mouseclick()=1
sprite 30, mousex(), mousey(), 6
clickstart=sprite collision(30,1)
clickend=sprite collision(30,2)
endif
`if start has been clicked
if clickstart=1
`past background image
paste image 8, 0, 0
`values of computer and quickstart
text 20, 20, str$(computer22)
text 20, 40, str$(clickstart)
`paste clickable RPS sprites then hide them
sprite 3, 27, 220, 9
hide sprite 3
sprite 4, 265, 220, 13
hide sprite 4
sprite 5, 460, 220, 14
hide sprite 5
`delete original start/quit sprites
delete sprite 1
delete sprite 2
wait 100
endif
`if mouse is clicked and the mouse sprite collides with RPS sprite
if mouseclick()=1
sprite 30, mousex(),mousey(), 6
clickpaper=sprite collision(30,13)
clickpaper=clickpaper+200
clickscissors=sprite collision(30,14)
clickscissors=clicksissors+300
clickrock=sprite collision(30,9)
clickrock=clickrock+100
`hide sprite 30
endif
`if rock is clicked
if clickrock=101
if computer=1
paste image 15, 0, 0
wait 1000
endif
if computer=2
paste image 16, 0, 0
wait 1000
endif
if computer=3
paste image 17, 0, 0
wait 1000
endif
endif
`if scissors is clicked
if clickscissors=301
if computer=1
paste image 21, 0, 0
endif
if computer=2
paste image 20, 0, 0
endif
if computer=3
paste image 15, 0, 0
endif
endif
`if paper is clicked
if clickpaper=201
if computer=1
paste image 18, 0, 0
endif
if computer=2
paste image 15, 0, 0
endif
if computer=3
paste image 19, 0, 0
endif
endif
`if end is clicked
if clickend=1
end
endif
sync
loop
hopefully these images will turn out okay? I'm not sure if i should post links or what.. so i think i'm going to link, to save people loading time? not sure about the etiquitte.
badgering since 1986