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.

Newcomers DBPro Corner / ASCII Game level

Author
Message
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 3rd Jun 2006 18:39 Edited at: 3rd Jun 2006 20:40
hi

I am trying to create a fun game which involves a 3d grid of cubes that the player has to navigate across. I figured the best way to do this was to load the data from an ascii file to create my levels but I have no idea how to go about doing this. I want to be able to load my cube .x models into a certain formation using this method.

P.s I am using DBP

Could anybody please help.

BM

Our aim is to keep the loo's clean, your aim can help.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 3rd Jun 2006 21:28
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 3rd Jun 2006 21:39 Edited at: 3rd Jun 2006 21:43
hi cucumber thanks for the reply. This is really helpful thanks loads.

BM

Our aim is to keep the loo's clean, your aim can help.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 3rd Jun 2006 21:51 Edited at: 3rd Jun 2006 21:53
EDIT: oh you edited your post before i posted this.so you dont need this explanation anymore, but ill just keep it as is.
first check the data statements at the bottom:
there are 5 numbers in a data statement,and 5 data statements
that means 5 numbers in a row and 5 numbers in a column

Next check the first part of code:
z = 1 to 5 and x = 1 to 5
while z = 1, x = 1,2,3,4,5
while z = 2, x = 1,2,3,4,5 again and so on..
read objectexist, objectexist is just a variable i made up it can be anything.the point is it reads a data number to this variable every increase of x and z in the for next loop
you see there are 1 and 0 in the data, so we check if variable objectexist is bigger than 0 objectexist > 0.
if so we increase another variable called a, which is going to be our object number. and accordingly we create a cube with the size 10.
then we position the object with the x and z variables which increase in the for next loop
when a = 1, z = 1 and x = 1
when a = 2, z = 1 and x = 2
when a = 3, z = 1 and x = 3 until 5...etc
when a = 8, z = 2 and x = 3 and so on.
soo if we multiply x with 50 there will be 50 unit difference between the last x and next x if you understand.
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 3rd Jun 2006 22:07
Oh right I understand it fully now but I have just been playing around with the code and I have no idea how you would change the formation of the blocks for say a level change.

Any help will be greatly recieved

Cheers

BM

Our aim is to keep the loo's clean, your aim can help.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 4th Jun 2006 00:20
basic concept is this:
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 4th Jun 2006 00:25
Oh ok I was on the right lines with my code then.

Thanks

BM

Our aim is to keep the loo's clean, your aim can help.

Login to post a reply

Server time is: 2024-11-27 17:47:03
Your offset time is: 2024-11-27 17:47:03