Post by OddChild on May 17, 2006 15:45:42 GMT -5
Hi guys,
I need some beta testers...
Username gu3st
Password cheese
christianmissiontrips.org/corkboard/index.php?topic=58.0
bellow is lvl1.exe ... Any ideas on how to make the background etc, acelerate when the car gets to the right side of the screen? Try the exe and you will see what i mean.
Thx
John
option explicit
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Declare our variables
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dim bRunning, tcar, x, y, fxcheck, ammount
Const Rad = 0.017453292519943
fxcheck = "cheese"
dim xtcar, ytcar, counter, truck, truckclone, boom, cheeseangle
counter = 0
dim mymusic, font1, xbackground, crash, deadman, btruckclone
dim goaway
goaway = 0
bRunning = True
dim bigtruck, bigtruck1
dim background ' variable for our animated image
'dim x, y ' variable for our curent position
x = 0
Dim imagewidth, imageheight, speed
imagewidth = 800 ' this is the width of our background image
imageheight = 600 ' this is the height of our background image
speed = 0.25 ' this is the speed we tell the background to scroll
'tcar = graphics.loadimage ("car.bmp")
xtcar = 100
ytcar = 400
dim phone
counter = -2000
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Our main routine
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub main()
if (graphics.initialize <> True) then exit sub
graphics.setTitle "TractBoy III The Harvest of Souls - The Drive there"
music.initialize
mymusic = music.loadmidi("loop1.mid")
music.playmidi mymusic
randomize
key.initialize ' initialze the keyboard routines so we can ESC the program
sound.initialize
phone = sound.loadwav("m1.wav")
sound.playwav phone
music.SetLoopPlay mymusic, true
background = graphics.loadimage("bg2.bmp", &HFFFF0000)' load the image with red being transparent
imagewidth = graphics.getwidth(background)
tcar = graphics.loadimage ("car.bmp")
' graphics.SetIcon("C:\afc.ico")
graphics.setscalex tcar, 2
graphics.setscaley tcar, 2
bigtruck1 = graphics.loadimage ("btruck.bmp")
graphics.setscalex bigtruck1, 2
graphics. setscaley bigtruck1, 2
graphics.setxy bigtruck1, 900, 300
graphics.setautogoto bigtruck1, -100, 320, 4020
truck = graphics.loadimage ("truck.bmp")
graphics.setscalex truck, 2
graphics.setscaley truck, 2
graphics.setxy truck, -800, 440
graphics.setautogoto truck, 1000, 440, 15000
Font1 = graphics.createFont ("System", 14)
boom = FX.LoadImage("fire.bmp")
with fx
.SetParticles boom, 200 ' number of particles
.Initialize boom, "explosion", 5 ' the scale of the fire
.SetR boom, .1
.SetG boom, .45
.SetB boom, .25
.SetA boom, 1
.SetRate boom, 100
end with
do while bRunning = True
graphics.setimage tcar
if key.pressed(1) or key.pressed(0) = True then bRunning = False
if key.pressed(200) = True then
' MoveatAngle tcar, 9 '
'xtcar = xtcar + .5 : graphics.setx tcar, xtcar : if xtcar > 610 then xtcar = 610 ' Right
xtcar= graphics.getX(tcar) + (Cos(graphics.getAngle(tcar))*Rad) * 25
ytcar = graphics.getY(tcar) - (Sin(graphics.getAngle(tcar))*Rad) * 25
' graphics.setimage tcar
end if
if xtcar > 610 then
xtcar = 610
' cheeseangle = 0
end if
'cheeseangle = cheeseangle + 0.5 : graphics.SetAngle tcar, cheeseAngle * Rad 'ytcar = ytcar - .5 : graphics.sety tcar, ytcar : if ytcar < 260 then ytcar = 260
' move Up
if key.pressed(208) = True then xtcar = xtcar - .15 : graphics.setx tcar, xtcar : if xtcar < 0 then xtcar = 0 ' ' Down
if key.pressed(203) = True then cheeseangle = cheeseangle + 0.5 : graphics.SetAngle tcar, cheeseAngle * Rad : if cheeseangle > 60 then cheeseangle = 60 : if cheeseangle < -60 then cheeseangle = -60'ytcar = ytcar + .5 : graphics.sety tcar, ytcar : if ytcar > 450 then ytcar = 450 ' Left
if key.pressed(205) = True then cheeseangle = cheeseangle - 0.5 : graphics.SetAngle tcar, cheeseAngle * Rad : if cheeseangle > 60 then cheeseangle = 60 : if cheeseangle < -60 then cheeseangle = -60
if xtcar < 0 then
xtcar = 0
'cheeseangle = 0
end if
if ytcar > 450 then
ytcar = 450
'cheeseangle = 0
end if
if ytcar < 260 then
ytcar = 260
' cheeseangle = 0
end if
' end if
if key.pressed(1) or key.pressed(0) = True then bRunning = False
xtcar = xtcar - .1 : graphics.setx tcar, xtcar : if xtcar < 0 then xtcar = 0
graphics.setxy tcar, xtcar, ytcar
'if cheeseangle > 60 then cheeseangle = 45 : if cheeseangle < -60 then cheeseangle = -60
graphics.clear 255 ' clear the screen
'ScrollBackground ' call the scroll sub routine
graphics.TileImage background, xbackground , 0
xbackground = xbackground + 0.25
if cheeseangle > 60 then cheeseangle = 45
if cheeseangle < -60 then cheeseangle = -60
if xtcar > 610 then
xtcar = 610
cheeseangle = 0
end if
if xtcar < 0 then
xtcar = 0
cheeseangle = 0
end if
if ytcar > 450 then
ytcar = 450
cheeseangle = 0
end if
if ytcar < 260 then
ytcar = 260
cheeseangle = 0
end if
graphics.setimage tcar
graphics.setimage truck
graphics.setimage bigtruck1
graphics.setimage truckclone
graphics.setimage btruckclone
crash = graphics.getcollision (tcar, truck)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, bigtruck1)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, truckclone)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, btruckclone)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, truck)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
counter = counter + 1
if counter < 0 then
graphics.settext "We need to get there before it rains.", 300,200,Font1
end if
dim cheese
if counter = 4000 then cheese = 1
if cheese = 1 then
'truck = graphics.loadimage ("truck.bmp")
truckclone = graphics.cloneimage (truck)
graphics.setscalex truckclone, 2
graphics.setscaley truckclone, 2
graphics.setxy truckclone, -200, 440
graphics.setautogoto truckclone, 1000, Int((440 - 370 + 1) * Rnd + 370), 15000
btruckclone = graphics.cloneimage (bigtruck1)
graphics.setscalex btruckclone, 2
graphics.setscaley btruckclone, 2
graphics.setxy btruckclone, 900, 330
graphics.setautogoto btruckclone, -100, Int((300 - 260 + 1) * Rnd + 260), 4020
counter = 0
cheese = 0
end if
if counter = 10000 then cheese = 1
if cheese = 1 then
truck = graphics.loadimage ("truck.bmp")
graphics.setscalex truck, 2
graphics.setscaley truck, 2
graphics.setxy truck, -800, 440
graphics.setautogoto truck, 1000, 440, 13000
cheese = 0
end if
FX.SetFX boom
if fxcheck = "now" then
goaway = goaway + graphics.Getx (tcar) - 0.25
FX.SetXY boom, goaway, graphics.Gety(tcar)
graphics.settext "You Died", 300,200,Font1
end if
graphics.display ' display our image
loop
key.terminate
sound.terminate
graphics.terminate
music.terminate
end sub
Call Main ' start the program
sub MoveatAngle(image, amount)
graphics.setx image, graphics.getX(image) + (Cos(graphics.getAngle(image))*Rad) * amount
graphics.setY image, graphics.getY(image) - (Sin(graphics.getAngle(image))*Rad) * amount
graphics.setimage image
end sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This is our routine to scroll a background image
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I need some beta testers...
Username gu3st
Password cheese
christianmissiontrips.org/corkboard/index.php?topic=58.0
bellow is lvl1.exe ... Any ideas on how to make the background etc, acelerate when the car gets to the right side of the screen? Try the exe and you will see what i mean.
Thx
John
option explicit
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Declare our variables
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dim bRunning, tcar, x, y, fxcheck, ammount
Const Rad = 0.017453292519943
fxcheck = "cheese"
dim xtcar, ytcar, counter, truck, truckclone, boom, cheeseangle
counter = 0
dim mymusic, font1, xbackground, crash, deadman, btruckclone
dim goaway
goaway = 0
bRunning = True
dim bigtruck, bigtruck1
dim background ' variable for our animated image
'dim x, y ' variable for our curent position
x = 0
Dim imagewidth, imageheight, speed
imagewidth = 800 ' this is the width of our background image
imageheight = 600 ' this is the height of our background image
speed = 0.25 ' this is the speed we tell the background to scroll
'tcar = graphics.loadimage ("car.bmp")
xtcar = 100
ytcar = 400
dim phone
counter = -2000
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Our main routine
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub main()
if (graphics.initialize <> True) then exit sub
graphics.setTitle "TractBoy III The Harvest of Souls - The Drive there"
music.initialize
mymusic = music.loadmidi("loop1.mid")
music.playmidi mymusic
randomize
key.initialize ' initialze the keyboard routines so we can ESC the program
sound.initialize
phone = sound.loadwav("m1.wav")
sound.playwav phone
music.SetLoopPlay mymusic, true
background = graphics.loadimage("bg2.bmp", &HFFFF0000)' load the image with red being transparent
imagewidth = graphics.getwidth(background)
tcar = graphics.loadimage ("car.bmp")
' graphics.SetIcon("C:\afc.ico")
graphics.setscalex tcar, 2
graphics.setscaley tcar, 2
bigtruck1 = graphics.loadimage ("btruck.bmp")
graphics.setscalex bigtruck1, 2
graphics. setscaley bigtruck1, 2
graphics.setxy bigtruck1, 900, 300
graphics.setautogoto bigtruck1, -100, 320, 4020
truck = graphics.loadimage ("truck.bmp")
graphics.setscalex truck, 2
graphics.setscaley truck, 2
graphics.setxy truck, -800, 440
graphics.setautogoto truck, 1000, 440, 15000
Font1 = graphics.createFont ("System", 14)
boom = FX.LoadImage("fire.bmp")
with fx
.SetParticles boom, 200 ' number of particles
.Initialize boom, "explosion", 5 ' the scale of the fire
.SetR boom, .1
.SetG boom, .45
.SetB boom, .25
.SetA boom, 1
.SetRate boom, 100
end with
do while bRunning = True
graphics.setimage tcar
if key.pressed(1) or key.pressed(0) = True then bRunning = False
if key.pressed(200) = True then
' MoveatAngle tcar, 9 '
'xtcar = xtcar + .5 : graphics.setx tcar, xtcar : if xtcar > 610 then xtcar = 610 ' Right
xtcar= graphics.getX(tcar) + (Cos(graphics.getAngle(tcar))*Rad) * 25
ytcar = graphics.getY(tcar) - (Sin(graphics.getAngle(tcar))*Rad) * 25
' graphics.setimage tcar
end if
if xtcar > 610 then
xtcar = 610
' cheeseangle = 0
end if
'cheeseangle = cheeseangle + 0.5 : graphics.SetAngle tcar, cheeseAngle * Rad 'ytcar = ytcar - .5 : graphics.sety tcar, ytcar : if ytcar < 260 then ytcar = 260
' move Up
if key.pressed(208) = True then xtcar = xtcar - .15 : graphics.setx tcar, xtcar : if xtcar < 0 then xtcar = 0 ' ' Down
if key.pressed(203) = True then cheeseangle = cheeseangle + 0.5 : graphics.SetAngle tcar, cheeseAngle * Rad : if cheeseangle > 60 then cheeseangle = 60 : if cheeseangle < -60 then cheeseangle = -60'ytcar = ytcar + .5 : graphics.sety tcar, ytcar : if ytcar > 450 then ytcar = 450 ' Left
if key.pressed(205) = True then cheeseangle = cheeseangle - 0.5 : graphics.SetAngle tcar, cheeseAngle * Rad : if cheeseangle > 60 then cheeseangle = 60 : if cheeseangle < -60 then cheeseangle = -60
if xtcar < 0 then
xtcar = 0
'cheeseangle = 0
end if
if ytcar > 450 then
ytcar = 450
'cheeseangle = 0
end if
if ytcar < 260 then
ytcar = 260
' cheeseangle = 0
end if
' end if
if key.pressed(1) or key.pressed(0) = True then bRunning = False
xtcar = xtcar - .1 : graphics.setx tcar, xtcar : if xtcar < 0 then xtcar = 0
graphics.setxy tcar, xtcar, ytcar
'if cheeseangle > 60 then cheeseangle = 45 : if cheeseangle < -60 then cheeseangle = -60
graphics.clear 255 ' clear the screen
'ScrollBackground ' call the scroll sub routine
graphics.TileImage background, xbackground , 0
xbackground = xbackground + 0.25
if cheeseangle > 60 then cheeseangle = 45
if cheeseangle < -60 then cheeseangle = -60
if xtcar > 610 then
xtcar = 610
cheeseangle = 0
end if
if xtcar < 0 then
xtcar = 0
cheeseangle = 0
end if
if ytcar > 450 then
ytcar = 450
cheeseangle = 0
end if
if ytcar < 260 then
ytcar = 260
cheeseangle = 0
end if
graphics.setimage tcar
graphics.setimage truck
graphics.setimage bigtruck1
graphics.setimage truckclone
graphics.setimage btruckclone
crash = graphics.getcollision (tcar, truck)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, bigtruck1)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, truckclone)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, btruckclone)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
crash = graphics.getcollision (tcar, truck)
if crash = true then
fxcheck = "now"
FX.SetXY boom, graphics.GetX(tcar), graphics.Gety(tcar)
FX.Initialize boom, "explosion", 50
graphics.SetVisible tcar, false
end if
counter = counter + 1
if counter < 0 then
graphics.settext "We need to get there before it rains.", 300,200,Font1
end if
dim cheese
if counter = 4000 then cheese = 1
if cheese = 1 then
'truck = graphics.loadimage ("truck.bmp")
truckclone = graphics.cloneimage (truck)
graphics.setscalex truckclone, 2
graphics.setscaley truckclone, 2
graphics.setxy truckclone, -200, 440
graphics.setautogoto truckclone, 1000, Int((440 - 370 + 1) * Rnd + 370), 15000
btruckclone = graphics.cloneimage (bigtruck1)
graphics.setscalex btruckclone, 2
graphics.setscaley btruckclone, 2
graphics.setxy btruckclone, 900, 330
graphics.setautogoto btruckclone, -100, Int((300 - 260 + 1) * Rnd + 260), 4020
counter = 0
cheese = 0
end if
if counter = 10000 then cheese = 1
if cheese = 1 then
truck = graphics.loadimage ("truck.bmp")
graphics.setscalex truck, 2
graphics.setscaley truck, 2
graphics.setxy truck, -800, 440
graphics.setautogoto truck, 1000, 440, 13000
cheese = 0
end if
FX.SetFX boom
if fxcheck = "now" then
goaway = goaway + graphics.Getx (tcar) - 0.25
FX.SetXY boom, goaway, graphics.Gety(tcar)
graphics.settext "You Died", 300,200,Font1
end if
graphics.display ' display our image
loop
key.terminate
sound.terminate
graphics.terminate
music.terminate
end sub
Call Main ' start the program
sub MoveatAngle(image, amount)
graphics.setx image, graphics.getX(image) + (Cos(graphics.getAngle(image))*Rad) * amount
graphics.setY image, graphics.getY(image) - (Sin(graphics.getAngle(image))*Rad) * amount
graphics.setimage image
end sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This is our routine to scroll a background image
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~