Media:
http://download.rct3rc.net/Simulator.zip
Well i'll explain why i made it open source in a min. First here's the code:
Unworking version (Someone if you manage to get this to work then repost it) 250 lines:
Rem Project: Simulator
Rem Created: 09/02/2006 21:17:39
Rem ***** Main Source File *****
set display mode 800, 600, 32
hide mouse
sync on
sync rate 60
autocam off
type vector
x as float
y as float
z as float
endtype
dim Ride(600) as vector
global TotalRides
global FileVersion
FileVersion=1
rem
load object "Carousel finished + textures.x", 9
scale object 9, 25, 25, 25
load image "Path.png", 27, 1
load object "Fence.x", 3
load image "Control panel.png", 26, 1
load image "steel01.BMP", 27, 1
texture object 3, 27
scale object 3, 45, 25, 45
`load music "Clear.mp3", 2
load object "terrain.x", 1
position object 9, object position x(1), object position y(1), object position z(1)
load image "Save 2.png", 22, 1
load image "terrain.bmp", 1, 1
load image "cursor_1-2s.png", 2, 1
Load image "Sky.png", 3, 1
load image "Title screen.png", 4, 1
load image "Play.png", 5, 1
load image "Exit.png", 6, 1
load image "In game menu.png", 7, 1
load image "Scenery icon.png", 11, 1
load image "Rides mini menu.png", 13, 1
load image "Shop icon.png", 9, 1
load image "Load 2.png", 14, 1
`load music "FruityTechTrance remixed.mp3", 1
`loop music 1
load image "Ride icon.png", 8, 1
load image "Stores mini menu.png", 15, 1
load image "Scenery mini menu.png", 24, 1
sprite 23, 10, 320, 22
sprite 21, 10, 250, 14
sprite 20, 135, 70, 15
sprite 19, 135, 50, 13
hide sprite 19
sprite 20, 135, 200, 15
sprite 6, 15, 50, 8
sprite 5, 10, 14, 7
sprite 10, 15, 120, 9
sprite 11, 15, 190, 11
hide sprite 21
hide sprite 10
hide sprite 11
hide sprite 6
hide sprite 5
make object sphere 2, -9000
hide object 2
hide sprite 23
position object 3, object position x(1)+2250, object position y(1)+10, object position z(1)+2200
rem menu
while menu:
if sprite collision (3, 1) and mouseclick()=1 then goto level
if sprite collision (4, 1) and mouseclick()=1 then goto exit1
endwhile
while escapekey()=0
sprite 1, mousex(), mousey(), 2
set sprite priority 1, 100
sprite 2, 0, 0, 4
sprite 3, 10, 10, 5
sprite 4 , 10, 500, 6
sprite 27, 100, -100, 26
set sprite priority 21, 2
set sprite priority 6, 2
set sprite priority 10, 2
set sprite priority 11, 2
set sprite priority 5, 1
set sprite priority 4, 2
set sprite priority 2, 2
set sprite priority 3, 2
set sprite priority 23,2
sync
endwhile
level:
pplace = 2
place = 1
`stop music 1
`loop music 2
hide sprite 20
hide sprite 3
hide sprite 2
hide sprite 4
show sprite 10
show sprite 11
cls
delete sprite 1
show sprite 23
show sprite 21
show sprite 5
show sprite 6
show object 2
position object 2, 0, -3, 0
texture object 2, 3
texture object 1, 1
scale object 1, 400, 400, 400
position object 1, 0, -2, 0
position camera 1358, 1188, 2314
set ambient light 400
set camera range 1,0x7fffffff
Shopmenu:
if mouseclick()=1 and sprite collision(10,1) then show sprite 20
if mouseclick()=2 and sprite collision(10,1) then hide sprite 20
return
ridemenu:
if SPRITE VISIBLE(19) then Text 190, 10, "Menu open" else text 10, 70, ""
if keystate(2)=1 then show sprite 19
if keystate(3)=1 then hide sprite 19
return
rem
do
sprite 1, mousex(), mousey(), 2
set sprite priority 1, 3
if sprite collision (6, 1) and mouseclick()=1 then goto ridemenu
if sprite collision (10, 1) and mouseclick()=1 then goto Shopmenu
if keystate(31)=1 then show mouse : file$=savedialog ("Save park file","Theme park files (*.prk)|*.prk|") :Save_PRK(file$): text 10, 10,"saving" : wait 100 :hide mouse: cls
if keystate(38)=1 then show mouse : file$=opendialog ("Load park file","Theme park files (*.prk)|*.prk|") :Load_PRK(file$): text 10, 10,"loading" : wait 100 :hide mouse: cls
if upkey()=1 then move camera 3
if downkey()=1 then move camera -3
if rightkey()=1 then pitch camera up 1
if leftkey()=1 then pitch camera down 1
if place = 1 and keystate(25)=1
inc x, 1
position object x,mousez(),3,object position z(x)
endif
if place = 1 and keystate(26)=1
inc x,1
position object x,object position x(x),3,mousez()
endif
if mouseclick() = 1
objX# = object position x(x)
objY# = object position y(x)
objZ# = object position z(x)
position object x,objX#,objY#,objZ#
pplace = 2
inc x,1
endif
return
`Carousel:
if place = 1 and keystate(10)=1
position object 9,object position x(9),3,mousez()
endif
if place = 1 and keystate(9)=1
position object 9,mousez(),3,object position z(9)
endif
if mouseclick() = 1
objX# = object position x(9)
objY# = object position y(9)
objZ# = object position z(9)
position object 9,objX#,objY#,objZ#
make_ride(x#,y#,z#)
place = 1
endif
return
turn object right 9, 1
if mouseclick()=2
yrotate camera camera angle y() + mousemovex()*0.3
xrotate camera camera angle x() + mousemovey()*0.3
endif
text 150,10,"Frames per second (Sync rate 60): "+str$(screen fps())
sync
loop
exit1:
end
function make_ride(x#,y#,z#)
inc TotalRides,1
Ride(TotalRides).x=x#
Ride(TotalRides).y=y#
Ride(TotalRides).z=z#
endfunction
function Save_PRK(file$)
alt$=file$+".prk"
open to write 1,alt$
write byte 1,FileVersion
`
write long 1,TotalRides
for a=1 to TotalRides
write word 1,a
write float 1,Ride(a).x
write float 1,Ride(a).y
write float 1,Ride(a).z
next a
close file 1
endfunction
`----------------------------------------------------------------------------
function Load_PRK(file$)
open to read 1,file$
read byte 1,version
if Version=FileVersion
else
print "Wrong File version"
endif
read long 1,ToRides
for a=1 to ToRides
read word 1,a
read float 1,Ride(a).x
read float 1,Ride(a).y
read float 1,Ride(a).z
next a
close file 1
endfunction
Working Slightly behind version 122 lines:
REM Project: Themesim_v0
REM Created: 30/10/2006 14:13:14
REM
REM ***** Main Source File *****
REM Right time to get this in the compo
Startblue "DW3" , "582e7f"
Set Camera range 1,0x7fffffff
hide mouse
rem
global Gadget1
global Gadget2
global Gadget3
global Gadget4
global Gadget5
global Gadget6
rem media
terrain=freeobject()
load object "terrain.x", terrain
load image "terrain.bmp",1, 1
texture object terrain,1
sky=freeobject()
make object sphere sky, -1000000000000000
load image "Sky.png", 2, 1
position object sky , 0, 0, 0
position object terrain ,0, -3, -2
scale object terrain , 20000, 20000, 20000
position camera object position x(terrain), object position y(terrain)+9000, object position z(terrain)
texture object sky, 2
scale object texture sky , 0.40, 0.40
Rem more media/sprites
load image "cursor_1-2s.png", 3, 1
mouse=freesprite()
menu2=freesprite()
load image "In game menu.png", 4
sprite menu2, 24 , 169, 4
Rem Create UI :)
CreateUI()
do
text 10, 10, "Park name: "+getgadgettext(Gadget4)
text 10, 20, "Camera X: "+str$(camera position X())
text 10, 30, "Camera Z: "+str$(camera position Z())
text 10, 40, "Mouse X: "+str$(mouseX())
text 10, 50, "Mouse y: "+str$(mousey())
control camera using arrowkeys 0, 30, 3
sprite mouse, mousex(), mousey(), 3
if keystate(2)=1 then show mouse else hide mouse
sync
loop
Rem Functions
`====================
function freeSprite()
`====================
`Gets an unused sprite number id
repeat
inc id
if sprite exist(id)=0 then found=1
until found
`=============
endfunction id
`=============
`====================
function freeObject()
`====================
`Gets an unused object number id
repeat
inc id
if object exist(id)=0 then found=1
until found
`=============
endfunction id
`=============
`========================
function freeLimb(object)
`========================
`Gets an unused limb number id for a specified object
repeat
inc id
if limb exist(object,id)=0 then found=1
until found
`=============
endfunction id
`=============
function freeImage()
`====================
`Gets an unused sprite number id
repeat
inc id
if image exist(id)=0 then found=1
until found
`=============
endfunction id
`---------------------
function createUI()
If Not GUI_CONSTANTS Then errorMessage "GUI Constants not defined. Please include gui.dba when you compile" : end
Gadget1=createStatusBar(0)
Gadget2=createProgressBar(557,0,75,23,Gadget1)
setGadgetAlign Gadget2,4
Gadget3=createWindow(0,752,209,240,"Park info",WINDOW_NORMAL,0,0,0)
Gadget4=createEdit(0,0,200,17,0,Gadget3)
Gadget5=createLabel(10,25,50,20,"Rides",Gadget3)
Gadget6=createListView(10,50,60,140,Gadget3)
endfunction
`Create Main Menu
`----------------
function createMainMenu()
menu=createMenu(0)
endfunction
Have fun I'll upload the media if anyone want's it
----
[start novel]
So why did i decide to make it open source?
Well kinda long story.
I just really decided coding wasn't my thing anymore after me and some friends spent a day just messing around down a village stream and just generally spending the whole day outside. So i've decided to do what i enjoy more and that's go out places more , See friends alot more , Cut down on pc alot. I'll still be posting here just in general chat and maybe post some feedback on other people's games
Do what you want with the code
Thanks
[/novel end]
Edit:Uploaded media see top of post