I have updated my entry code with more variety in buildings, and some street traffic. Also added timer control to maintain constant animation speed, reduced poly count for performance.
set display mode 1024,768,32
backdrop on
color backdrop 0
hide mouse
dim txtr(10,4)
dim c(5)
c(1)=32
c(2)=32
c(3)=64
c(4)=64
c(5)=254
dim emisv(5)
emisv(1)=rgb(192,128,128)
emisv(2)=rgb(128,192,128)
emisv(3)=rgb(128,128,192)
emisv(4)=rgb(128,128,128)
emisv(5)=rgb(192,128,192)
dim st(17)
global next_obj=0
global next_txtr=0
side=400
set image colorkey 250,250,250
transparent=rgb(250,250,250)
rem Create textures for building
create bitmap 1,250,480
ink 0,0
box 0,0,250,250
blank=next_texture()
get image blank,0,0,250,250
winx=15
winy=12
for t=1 to 10 rem Create sides of building for all heights of buildings
height=t*10+10
ink 0,0
box 0,0,250,400
for u=1 to 4
txtr(t,u)=next_texture()
for x=5 to 230 step 20
for y=5 to height*4-20 step 20
col=rnd(4)+1
ink rgb(c(col)/7,c(col)/7,c(col)/7),0
box x,y,x+winx,y+winy
ink rgb(c(col)/5,c(col)/5,c(col)/5),0
box x+1,y+1,x+winx-1,y+winy-1
ink rgb(c(col)/3,c(col)/3,c(col)/3),0
box x+2,y+2,x+winx-2,y+winy-2
ink rgb(c(col),c(col),c(col)),0
box x+3,y+3,x+winx-3,y+winy-3
next y
next x
ink rgb(128,128,255),0
get image txtr(t,u),0,0,250,height*4
next u
next t
rem Make signs
total_signs=3
dim sign$(total_signs)
dim col(total_signs,3)
dim isign(total_signs)
sign$(1)="AceLepage Co.":col(1,1)=rgb(64,64,255):col(1,2)=240:col(1,3)=300
sign$(2)="Skyluke Inc.":col(2,1)=rgb(255,64,64):col(2,2)=360:col(2,3)=400
sign$(3)="thegamecreators":col(3,1)=rgb(64,255,64):col(3,2)=360:col(3,3)=300
for x=1 to total_signs
ink 0,0
box 0,0,250,250
ink col(x,1),0
set text font "arial"
set text size 20
set text to bold
set cursor 10,0
print sign$(x)
isign(x)=next_texture()
get image isign(x),0,0,150,30
next x
delete bitmap 1
set current bitmap 0
rootobj=next_object()
rem Make buildings
make object box rootobj,50,10,50
make mesh from object 2,rootobj
hide object rootobj
for x=-660 to 800 step 60
if x<280 or x>320 rem Avoid putting buildings on main street
for y=-200 to 800 step 100
building=next_object()
build=rnd(9)+1
width=rnd(1)*25+25
height=build*10+10
sh=(height+10)/2
clone object building,rootobj
texture object building,blank
make object plain side,50,height
make mesh from object 1,side
delete object side
scale limb building,0,100,height*10,width*2
offset limb building,0,0,height/2+15,(50-width)/2.0
add limb building,1,1
add limb building,2,1
add limb building,3,1
add limb building,4,1
texture limb building,1,txtr(build,1)
texture limb building,2,txtr(build,2)
texture limb building,3,txtr(build,3)
texture limb building,4,txtr(build,4)
rotate limb building,2,0,90,0
rotate limb building,3,0,180,0
rotate limb building,4,0,270,0
offset limb building,1,0.1,sh,25.1
offset limb building,2,25.1,sh,(50-width)/2.0+0.1
offset limb building,3,0.1,sh,-width+24.9
offset limb building,4,-25.1,sh,(50-width)/2.0+0.1
scale limb building,2,width*2,100,100
scale limb building,4,width*2,100,100
scale limb texture building,2,width/50.0,1
scale limb texture building,4,width/50.0,1
nextlimb=5
rem If building is narrow, add an addition, if building is close to camera viewing area
if width=25 and build>2 and (x>0 and x<600 and y>0 and y<600)
add limb building,5,1
add limb building,6,1
add limb building,7,1
texture limb building,5,txtr(build,1)
texture limb building,6,txtr(build,2)
texture limb building,7,txtr(build,1)
rotate limb building,5,0,90,0
rotate limb building,6,0,180,0
rotate limb building,7,0,270,0
scale limb building,5,50,50,100
scale limb building,6,50,50,100
scale limb building,7,50,50,100
offset limb building,5,0,sh/2+5,-12.5
offset limb building,6,-12.5,sh/2+5,-25
offset limb building,7,-25,sh/2+5,-12.5
scale limb texture building,5,width/50.0,0.5
scale limb texture building,6,width/50.0,0.5
scale limb texture building,7,width/50.0,0.5
add limb building,8,2
texture limb building,8,blank
scale limb building,8,50,50,50
offset limb building,8,-12.5,sh+5,-12.5
orient=rnd(3)*90
yrotate object building,orient
nextlimb=9
endif
delete mesh 1
for signs=1 to total_signs
if x=col(signs,2) and y=col(signs,3)
nextsign=next_object()
make object plain nextsign,48,10
texture object nextsign,isign(signs)
set object emissive nextsign,rgb(255,255,255)
if x<300
yrotate object building,90
yrotate object nextsign,90
position object nextsign,x+25.5,sh*2+5,y
else
yrotate object building,270
yrotate object nextsign,270
position object nextsign,x-25.5,sh*2+5,y
endif
endif
next signs
glow=rnd(4)+1
set object emissive building,emisv(glow)
position object building,x,5,y
next y
endif
next x
rem Make street
create bitmap 1,600,30
ink transparent,0
box 0,0,600,30
ink rgb(255,255,255),0
for x=0 to 600 step 10
box x,0,x+1,1
box x,29,x+1,30
next x
ist1=next_texture()
get image ist1,0,0,600,30
ink transparent,0
box 0,0,600,30
ink rgb(255,255,255),0
for x=0 to 600 step 100
for y=0 to 60 step 10
box x+y,0,x+y+1,1
box x+y,29,x+y+1,30
next y
next x
ist2=next_texture()
get image ist2,0,0,600,30
delete bitmap 1
set current bitmap 0
street=next_object()
make object plain street,600,30
texture object street,ist1
rotate object street,270,0,0
fix object pivot street
set object transparency street,1
for x=1 to 16
st(x)=next_object()
instance object st(x),street
next x
hide object street
for x=1 to 8
position object st(x),-25,25,x*100-150
position object st(x+8),610,25,x*100-150
next
street2=next_object()
make object plain street2,600,30
texture object street2,ist2
rotate object street2,270,0,0
fix object pivot street2
set object transparency street2,1
x=7
st(x)=next_object()
instance object st(x),street2
yrotate object street2,90
yrotate object st(x),90
position object street2,295,30,-30
position object st(7),295,25,570
rem Make cars
create bitmap 1,20,10
ink 0,0
box 0,0,20,10
create_fuzzy(0,0,10,255,255,255)
create_fuzzy(10,0,10,255,255,255)
headlights=next_texture()
get image headlights,0,0,20,10
create_fuzzy(0,0,10,255,0,0)
create_fuzzy(10,0,10,255,0,0)
taillights=next_texture()
get image taillights,0,0,20,10
delete bitmap 1
set current bitmap 0
total_cars=40
dim car(total_cars)
dim carmove(total_cars,2) as float
dim cardir(total_cars,2)
for x=1 to total_cars
car(x)=next_object()
make object plain car(x),4,4
make mesh from object 1,car(x)
add limb car(x),1,1
add limb car(x),2,1
delete mesh 1
offset limb car(x),1,0,0,-2
rotate limb car(x),1,0,180,0
offset limb car(x),2,0,0,2
texture limb car(x),1,headlights
texture limb car(x),2,taillights
set object emissive car(x),rgb(255,255,255)
cardir(x,1)=2
if (x<total_cars/2)
cardir(x,2)=1
carmove(x,1)=300
carmove(x,2)=x*50+rnd(25)-300
else
cardir(x,2)=-1
carmove(x,1)=290
carmove(x,2)=(x-(total_cars)/2)*50+rnd(45)
yrotate object car(x),0
endif
hide limb car(x),0
next x
cama#=0.0
top#=50.0
camd#=200.0
camspeed#=15 rem Degress per second
carspeed#=10 rem Units per second
while not escapekey()
speed#=carspeed#*elapsed/1000.0
for x=1 to total_cars
carmove(x,cardir(x,1))=carmove(x,cardir(x,1))+speed#*cardir(x,2)
if carmove(x,cardir(x,1))>800
carmove(x,cardir(x,1))=carmove(x,cardir(x,1))-1200
endif
if carmove(x,cardir(x,1))<-400
carmove(x,cardir(x,1))=carmove(x,cardir(x,1))+1200
endif
position object car(x),carmove(x,1),20,carmove(x,2)
next x
camx#=camd#*sin(cama#)
camy#=sin(cama#+180)*top#+300
camz#=camd#*cos(cama#)
position camera camx#+300,camy#,camz#+300
point camera 300,100,300
cama#=wrapvalue(cama#+camspeed#*elapsed/1000.0)
elapsed=timer()-time
time=timer()
endwhile
end
function next_object()
inc next_obj
endfunction next_obj
function next_texture()
inc next_txtr
endfunction next_txtr
rem Fuzzy lights function c/o Valle
function create_fuzzy(xpos,ypos,rad,red,green,blue)
for x = 0 to rad*2-1
for y = 0 to rad*2-1
dist# = sqrt((x-rad)^2+(y-rad)^2)
illum# = (rad-dist#)*1.0/rad
if illum# < 0 then illum# = 0
illum#=illum# ^ 2
ink rgb(red*illum#,green*illum#,blue*illum#),0
dot xpos+x,ypos+y
next y
next x
endfunction
( 2b || !2b ), that is the question. The answer: true