Code: Select all
SCREEN 1024,768,24
FrameLimit 30
kuva = LoadObject("Media\car.bmp", 72)
kuva1 = LoadObject("Media\car.bmp", 72)
kuva2 = LoadObject("Media\car2.bmp", 72)
kuva3 = LoadObject("Media\car2.bmp", 72)
poistu = LoadObject("Media\poistu.jpg", 72)
x=0
y=1
z=1
Osumia_auto = 0
Osumia_auto2 = 0
Const Ammusnopeus = 8
Const latausnopeus = 5
Const autojennopeus = 8
Const autojenkäännösnopeus = 5
Const peruutusnopeus = 2
Const CPUautonnopeus = 7
Const CPU_reagointiaika = 300 // 1000 = 1 sec
Const CPU_amupumis_etäisyys = 200
Repeat // valikko
Color cborange
Box 350,20,400,100,0
Text 450,50, "Valitse pelaajien määrä"
Text 905,8, "Versio 0.01"
Text 450,350, " Valitse Kenttä"
Box 460,340,200,40,0
PositionObject kuva1, -70 ,147
PositionObject kuva2, 350 ,165
PositionObject kuva3, 350 ,125
PositionObject kuva, -350,310
TurnObject kuva,5
If kentta=1 Then Color cbred
If kentta<1 Or kentta>1 Then Color cborange
Box 200,400,300,60,0
Text 250, 430, "1. Orginal map"
If kentta=3 Then Color cbred
If kentta<3 Or kentta>3 Then Color cborange
Box 200,500,300,60,0
Text 250, 530, "3. BigRace map"
If kentta=2 Then Color cbred
If kentta<2 Or kentta>2 Then Color cborange
Box 600,400,300,60,0
Text 650, 430, "2. Race map"
If x=1 Then Color cbred
If x<1 Or x>1 Then Color cborange
Box 200,200,300,80,0
Text 250, 230, "1. Yksi pelaaja" //200,199...200,278..499..278
If x=2 Then Color cbred
If x<2 Or x>2 Then Color cborange
Box 600,200,300,80,0
Text 650, 230, "2. Kaksi pelaajaa"
Color cborange
If vihu_elossa=ON Then Color cbred
Box 645,248,60,20,0
Text 650,250, "CPU"
Color cborange
If vihu_elossa=OFF Then Color cbred
Box 745,248,60,20,0
Text 750,250, "Human"
Color cborange
If y=0 Then Color cbred
If y<0 Or y>0 Then Color cborange
Box 980,30,36,30,0 //off
Text 905, 38, " OFF"
If y=1 Then Color cbred
If y<1 Or y>1 Then Color cborange
Box 940,30,40,30,0 // on
Text 905, 38, " ON"
Color cborange
Text 905, 38, "Musa"
//Text 905, 38, "Musa ON OFF"
Box 900,700,100,50,0
Text 950, 725, "Exit"
PositionObject poistu, 412 ,-342
If x=1 Or x=2 And kentta=1 Or kentta=2 Then Color cbwhite
Box 30,700,100,30,0
Text 38, 710, "Start GO"
If MouseX()>645 And MouseX()<705 And MouseY()<308 And MouseY()>248 Then
If MouseUp(1)
vihu_elossa=ON //player2 CPU
EndIf
EndIf
If MouseX()>745 And MouseX()<805 And MouseY()<308 And MouseY()>248 Then
If MouseUp(1)
vihu_elossa=OFF //player2 Human
EndIf
EndIf
If MouseX()>200 And MouseX()<500 And MouseY()<278 And MouseY()>199 Then
If MouseUp(1)
x=1 //players 1
EndIf
EndIf
If MouseX()>600 And MouseX()<900 And MouseY()<278 And MouseY()>199 Then
If MouseUp(1)
x=2 //players 2
EndIf
EndIf
If MouseX()>200 And MouseX()<500 And MouseY()<460 And MouseY()>400 Then
If MouseUp(1)
kentta=1 // kenttä 1
EndIf
EndIf
If MouseX()>600 And MouseX()<900 And MouseY()<460 And MouseY()>400 Then
If MouseUp(1)
kentta=2 // kenttä 2
EndIf
EndIf
If MouseX()>200 And MouseX()<500 And MouseY()<560 And MouseY()>500 Then
If MouseUp(1)
kentta=3 // kenttä 3
EndIf
EndIf
If MouseX()>940 And MouseX()<980 And MouseY()<60 And MouseY()>30 Then
If MouseUp(1)
y=1 //musa päällä
EndIf
EndIf
If MouseX()>981 And MouseX()<1016 And MouseY()<60 And MouseY()>30 Then
If MouseUp(1)
y=0 //musa pois
EndIf
EndIf
If MouseX()>30 And MouseX()<130 And MouseY()<730 And MouseY()>700 Then
If MouseDown(1)
If x=1 Or x=2 And kentta=1 Or kentta=2 Then Color cbred
Box 30,700,100,30,0
Text 38, 710, "Start GO"
DrawScreen
Wait 700
Gosub alku
EndIf
EndIf
If MouseX()>900 And MouseX()<1000 And MouseY()<750 And MouseY()>700 Then
If MouseUp(1)
Color cbred
Box 900,700,100,50,0
Text 950, 725, "Exit"
DrawScreen
Wait 500
End
EndIf
EndIf
If y=1 Then
If SoundPlaying(musa)=0 Then
musa = PlaySound ("Media\SK_Battle2.mp3")
If Rand(1,2)=1 Then
SetSound musa,0,100,-100 'vasen kajari
Else
SetSound musa,0,100,100 'oikea kajari
EndIf
EndIf
EndIf
If y=0 Then StopSound musa
//RotateObject car5,0
//PositionObject car5, 300,500
//TurnObject car5, 5
// Text 10,1, MouseX()
// Text 10,11, MouseY()
DrawScreen
Forever
End
Tässä minun vähän hutasten tehty valikko.. Lisäilty aina nappeja, kun tarvetta on tullut... Olen käyttänyt CoolBasiciä kaksi päivää, ja tämä on minusta EHDOTTOMASTI helpoin ohjelmointikieli.