Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / deleting objects

Author
Message
DaedalusX
21
Years of Service
User Offline
Joined: 10th Mar 2004
Location:
Posted: 13th Nov 2004 03:05
im makinga 2d map and using the 3d plain object as tiles. when i delete them to goto the next map the system wont recreate them when i have commanded to. y is this?
[/code]
`¬¬¬¬¬¬¬¬¬¬Area Changing¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
sync on
sync rate 30
set display mode 1024,768,16



world1:
cls
load image "grass08.bmp",1
load image "ash01.bmp",2
dim world1(5,5)
for y=0 to 4
for x=0 to 4
if world1data < 1 then restore world1data
read world1data

world1(x,y)=world1data
next x
next y



for y=0 to 4
for x=0 to 4
objnum = objnum + 1
make object plain objnum,5,5
position object objnum,x*5,y*5,75
if world1(x,y)> 0 then texture object objnum,world1(x,y) else color object objnum,0
next x
next y

do


if mouseclick()=1
delete image 1
delete image 2
for y=0 to 4
for x=0 to 4
delete object objnum
next y
next x
undim world1(5,5)
goto world2
endif

` X,Y,ZOOM
position camera 0,0,-10
xrotate camera 0.0
yrotate camera angle#
zrotate camera 0.0

sync
loop




world2:
cls
load image "grass08.bmp",1
load image "ash01.bmp",2

dim world2(10,10)
for y=0 to 9
for x=0 to 9
if world2data < 1 then restore world2data
read world2data

world2(x,y)=world2data
next x
next y



for y=0 to 9
for x=0 to 9
objnum = objnum + 1
make object plain objnum,10,10
position object objnum,x*10,y*10,75
if world2(x,y)> 0 then texture object objnum,world2(x,y) else color object objnum,0
next x
next y

do

if mouseclick()=2
delete image 1
delete image 2
for y=0 to 9
for x=0 to 9
delete object objnum
next y
next x
undim world2(10,10)
goto world1
endif


position camera 0,0,-10
xrotate camera 0.0
yrotate camera angle#
zrotate camera 0.0
sync
loop

world1data:
data 1,2,1,2,1
data 2,1,2,1,2
data 1,2,1,2,1
data 2,1,2,1,2
data 1,2,1,2,1


world2data:
data 1,1,1,1,1,1,1,1,1,1
data 2,2,2,2,2,2,2,2,2,2
data 1,1,1,1,1,1,1,1,1,1
data 2,2,2,2,2,2,2,2,2,2
data 1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1
data 2,2,2,2,2,2,2,2,2,2
data 1,1,1,1,1,1,1,1,1,1
data 2,2,2,2,2,2,2,2,2,2
data 1,1,1,1,1,1,1,1,1,1
[code]

All help appreciated. thanx in advance

Daedalus
Ali M Oldboy
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: England, UK
Posted: 13th Nov 2004 03:40
Create a new .DBA file

and add this



-ALI-

N U K E S O F T :: EXPLOSIVE GAMES ::
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 13th Nov 2004 04:51
Are you kidding me? thers no such command as LOAD!!!

Song of the whenever i feel like updating it....
Man in a Dress, by Stew
Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 13th Nov 2004 04:59
maybe he meant include... not that i see how it'd help...

DaedalusX
21
Years of Service
User Offline
Joined: 10th Mar 2004
Location:
Posted: 13th Nov 2004 06:07
that didnt work just brouht up the plain black screen. *slaps source code*

Daedalus

Login to post a reply

Server time is: 2025-05-27 18:38:50
Your offset time is: 2025-05-27 18:38:50