`Sphereland! (Corny, I know. Can't help it.)
sync on : sync rate 60 : hide mouse
`set up data for talk
Dim said$(4,3)
said$(1,1)="Hello, Sphere, how are you today?"
said$(1,2)="Can I help you with anything?"
said$(1,3)="Okay, Okay, you just want to talk to me."
said$(2,1)="Hey, my name's Cole!"
said$(2,2)="You're Sphere? Wow Cool!"
said$(2,3)="It's really awesome to meet you!"
said$(3,1)="Hi, I'm Snowball"
said$(3,2)="It's kinda hot in here."
said$(3,3)="Find the thermostat, will ya? thanks!"
said$(4,1)="How's it. I'm Bean."
said$(4,2)="When's the Daygamer going finish this."
said$(4,3)="Hey, I can't just talk all day to you, alright."
`set camera height
newcy#=200.0
`sphere!
make object sphere 1,25
x#=700 : z#=700
`load image "textures\sphere.bmp",1
`texture object 1,1
color object 1,rgb(0,0,255)
yrotate object 1,90 : fix object pivot 1
`house
`load object "rooms\house\house.x",2
`position object 2,1000,96,1000
`sphere's friends
make object sphere 3,25
position object 3,1000,13.5,1000
color object 3,RGB(255,255,0)
make object sphere 4,25
position object 4,1700,13.5,1700
color object 4,RGB(0,0,0)
make object sphere 5,25
position object 5,1000,13.5,1800
color object 5,RGB(255,255,255)
make object sphere 6,25
position object 6,500,13.5,1400
color object 6,RGB(0,128,18)
`matrix
make matrix 1,10000,10000,100,100
`load image "textures\grass.bmp",3
`prepare matrix texture 1,3,1,1
randomize matrix 1,2
position matrix 1,-5000,-2,-5000
rem main loop
do
set cursor 10,10 : print "x:",object position x(1)
set cursor 10,30 : print "z:",object position z(1)
set cursor 10,50 : print "y:",object position y(1)
a# = object angle Y(1)
`controls
if upkey()=1 then x#=newxvalue(x#,a#,5) : z#=newzvalue(z#,a#,5)
if downkey()=1 then x#=newxvalue(x#,a#,-5) : z#=newzvalue(z#,a#,-5)
if leftkey()=1 then a#=wrapvalue(a#-5.0)
if rightkey()=1 then a#=wrapvalue(a#+5.0)
rem Update player position
y#=get ground height(1,x#,z#)+13.5
position object 1,x#,y#,z#
rem update player rotation
Yrotate object 1,a#
`talk to friends
if returnkey()=0 then press=0
if object collision(1,3)
collision=1
if press=0 and returnkey()=1 then press=1 : gosub talk
endif
if object collision(1,4)
collision=2
if press=0 and returnkey()=1 then press=1 : gosub talk
endif
if object collision(1,5)
collision=3
if press=0 and returnkey()=1 then press=1 : gosub talk
endif
if object collision(1,6)
collision=4
if press=0 and returnkey()=1 then press=1 : gosub talk
endif
`camera
cx#=newxvalue(x#,wrapvalue(a#+180),200)
cz#=newzvalue(z#,wrapvalue(a#+180),200)
cy#=get ground height(1,cx#,cz#)+200.0
if cy#>newcy# then inc newcy#,0.05
if cy#<newcy# then dec newcy#,0.05
position camera cx#,newcy#,cz#
point camera x#,y#+100,z#
rem end loop
sync
loop
`talk to buddy==============================================================================
talk:
if collision=1
if count3<4 then inc count3
count=count3
endif
if collision=2
if count4<4 then inc count4
count=count4
endif
if collision=3
if count5<4 then inc count5
count=count5
endif
if collision=4
if count6<4 then inc count6
count=count6
endif
for a = 1 to len(said$(collision,count))
`make said bubble
ink rgb(255,255,255),0
box 100,10,540,120
ink rgb(0,0,255),0
box 100,8,540,12
box 100,118,540,122
box 98,10,102,120
box 538,10,542,120
set text size 20
set cursor 130,22
ink RGB(0,0,255),RGB(0,0,255)
for b = 1 to a
print mid$(said$(collision,count),b);
next b
wait 50
if returnkey()=0 then press=0
if press=0 and returnkey()=1 then press=1 : exit
sync
next a
`talk end loop-----------------------------
r=2
do
`make said bubble
ink rgb(255,255,255),0
box 100,10,540,120
ink rgb(0,0,255),0
box 100,8,540,12
box 100,118,540,122
box 98,10,102,120
box 538,10,542,120
ink RGB(0,0,255),0
set cursor 130,22
print said$(collision,count)
`make end circle
coolcircle=coolcircle+1
if coolcircle=50
if r=2 then r=4 : else r=2
coolcircle=0
endif
circle 525,105,r
circle 525,105,r+1
if returnkey()=0 then press=0
if press=0 and returnkey()=1 then press=1 : exit
sync
loop
`go back to main loop
return
I thought I'd post my code incase anybody's trying to benefit from this thread. I remmed out the media commands so you can just copy and paste it.
I will add some sliding collision and other stuff when I get the chance. It looks like there's an error when you talk to a sphere more than 3 times...
Have a nice day, God Bless You!