Posted: 19th Nov 2010 00:03
[/code]
for x = 1 to 1000
if object exist(x) = 1 then delete object x
if matrix exist(x) = 1 then delete matrix x
if mesh exist(x) = 1 then delete mesh x
if light exist(x) = 1 then delete light x
if x <= 32
if animation exist(x) = 1 then delete animation x
endif
next x
load image "Untitled1.bmp",11
load image "Untitled.bmp",10
make object sphere 11,50
scale object 11,600,600,250
rotate object 11,0,180,10
position object 11,235,0,10
texture object 11,10
make object box 12,10,520,1000
position object 12, 200,00,0
yrotate object 12,10
color object 12, rgb(255,255,0)
make object box 20,250,100,10
position object 20,200,155,235
yrotate object 20,90
color object 20,rgb(0,0,0)
make object box 21,250,50,10
position object 21,200,30,235
yrotate object 21,90
color object 21,rgb(0,0,0)
make object box 22,250,50,10
position object 22,200,-30,235
yrotate object 22,90
color object 22,rgb(0,0,0)
make object box 23,250,50,10
position object 23,200,-150,235
yrotate object 23,90
color object 23,rgb(0,0,0)
make object box 24,250,50,10
position object 24,200,-90,235
yrotate object 24,90
color object 24,rgb(0,0,0)
make object box 15,10,125,125
position object 15,75,15,00
color object 15,rgb(50,255,50)
make object box 16,10,125,125
position object 16,118,118,0
zrotate object 16,315
color object 16,rgb(255,50,50)
m=0
n=0
b=0
h=0
make object box 17,10,125,125
position object 17,118,-90,0
zrotate object 17,45
color object 17,rgb(255,50,50)
i=1
if i=1 then c=rnd(4)
do
if scancode() = 0 then exit
loop
do
if mouseclick()=1 and o=1 then w=1 : y=0
if mouseclick()=1 and m=1 then n=1
if i=1
v=c
if v=0
1q$="Question 1"
1a$="A) Answer 1"
1b$="B) Answer 2"
1c$="C) Answer 3"
1d$="D) Answer 4"
l=1
text 150,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
v=6
endif
if v=1
1q$="Question 2"
1a$="A) Answer 1"
1b$="B) Answer 2"
1c$="C) Answer 3"
1d$="D) Answer 4"
l=1
text 150,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
v=6
endif
if v=2
1q$="Question 3"
1a$="A) Answer 1"
1b$="B) Answer 2"
1c$="C) Answer 3"
1d$="D) Answer 4"
l=1
text 150,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
v=6
endif
if v=3
1q$="Question 4"
1a$="A) Answer 1"
1b$="B) Answer 2"
1c$="C) Answer 3"
1d$="D) Answer 4"
l=1
text 150,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
v=6
endif
if v=4
1q$="Question 5"
1a$="A) Answer 1"
1b$="B) Answer 2"
1c$="C) Answer 3"
1d$="D) Answer 4"
l=1
text 150,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
v=6
endif
endif
if l=1
if inkey$()="a"
i=0
o=1
y=1
l=0
endif
endif
if y=1
1q$="Correct! spin wheel (mouse click)"
1a$=" "
1b$=" "
1c$=" "
1d$=" "
text 100,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
endif
if w=1
color object 15,rgb(255,50,50)
color object 16,rgb(50,255,50)
color object 17,rgb(50,255,50)
texture object 11,11
wait 300
color object 15,rgb(50,255,50)
color object 16,rgb(255,50,50)
color object 17,rgb(255,50,50)
texture object 11,10
wait 300
color object 15,rgb(255,50,50)
color object 16,rgb(50,255,50)
color object 17,rgb(50,255,50)
texture object 11,11
wait 300
color object 15,rgb(50,255,50)
color object 16,rgb(255,50,50)
color object 17,rgb(255,50,50)
texture object 11,10
wait 300
color object 15,rgb(255,50,50)
color object 16,rgb(50,255,50)
color object 17,rgb(50,255,50)
texture object 11,11
wait 300
color object 15,rgb(50,255,50)
color object 16,rgb(255,50,50)
color object 17,rgb(255,50,50)
texture object 11,10
wait 300
color object 15,rgb(255,50,50)
color object 16,rgb(50,255,50)
color object 17,rgb(50,255,50)
texture object 11,11
wait 300
color object 15,rgb(50,255,50)
color object 16,rgb(255,50,50)
color object 17,rgb(255,50,50)
texture object 11,10
w=0
i=0
o=0
u=1
endif
if u=1
1q$="Question 2"
1a$="A) Answer 1"
1b$="B) Answer 2"
1c$="C) Answer 3"
1d$="D) Answer 4"
text 150,50,1q$
text 150,200,1a$
text 150,260,1b$
text 150,320,1c$
text 150,380,1d$
endif
REM MOVE CAMERA
cpZ# = Newzvalue(z#,ay-180,200)
cpX# = Newxvalue(x#,ay-180,200)
if cpX#<-19990 then cpX#=-19990
if cpZ#<-19990 then cpZ#=-19990
if cpX#>19990 then cpX#=19990
if cpZ#>19990 then cpZ#=19990
position camera -200,0,200
point camera 50.34,0,150
loop
[code]
I want it to randomly chose a question in the code. But since the v=rnd(4) is in the do loop it Shows all questions at once.
When ever i move the rnd(4) somewhere else it wont work
How can i get it to only show one question at random?
Please Help
-Thanks