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 / processes etc.

Author
Message
someone namedlink
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: Dream Planet
Posted: 3rd Aug 2004 23:26
hello,

I have programmed in DIV for a few years now and I find it very usefull for making games. But my last game looks terrible with only 256 colors! So I am trying to do it with DBP but the code looks so strange. In div you can make a process so that you can have an object that 'lives on it's own' and make as many as you want of it. But I can't find something similar in DBP??? How can I program my different objects?(2D) here is some code of a process:

DIV/DBP-coder
AsriCE
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 4th Aug 2004 02:53
It looks like you're talking about Functions. I've never programmed in DIV, so I don't really know the way the language goes. But since your subject is "Processes" and in your supplied code, the command "PROCESS" is creating a new function called Card(). In DBP, you would do it the same way, except use the Function command instead of PROCESS. As follows:



Maybe I didn't really get you right. But still, hope that helps

AsriCE Crew,
- Adi

There's only one hope.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 4th Aug 2004 05:07 Edited at: 4th Aug 2004 05:08
AsriCE,

That may or may not help exactly. While I agree the structure of our function operation is similar to the process one cited, the functions in Dark Basic do not create independant processes that "live on their own." The closest thing we have to such a multitasking is the array object, where each object in that array must be updated during the main game loop. Functions can built to do the updating and such, but it's not really the same, only similar.

someone namedlink, I think you're going to find that changing over to DB is going to be a learning process, because it is a very different environment. This means you're going to have to do a little re-think on how to do things now as you are used to. Good luck!

S.

Any truly great code should be indisguishable from magic.
someone namedlink
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: Dream Planet
Posted: 4th Aug 2004 07:01
thx,

I now see how the language work. There is no need for processes because you give to each sprite a number so you know wich sprite is wich. So if I want to move it, I use the sprite number and a function that moves it instead of a process for a sprite with code in it.

DIV/DBP-coder
AsriCE
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 4th Aug 2004 15:01
hehe .. ok I geddit now. Nothing in DBP lives on it's own. You need to code it yourself to instruct how the object moves, thus making DBP very flexible. Every single sprite/3D object/sound you create is identified by a number, and you can use this ID number to do all sorts of interesting things to it by calling in specific commands individually

Just for your info, here is the basic framework of a DB program.

Quote: "
Rem Initialisation
Initialise Variables
Load All Medias (Sprites, Objects, Music ETC)
Initialise Objects (Initial Position and such)

Rem Main Loop (Where we do most of the process)
Do
Read-In User Input
Do Other Interesting Things ( A.I, Collision ETC)
Update All Object's Position Accordingly
Loop

Rem Free Memory And End Program
Destory Objects
Destroy Variables
End"


AsriCE Crew,
- Adi

There's only one hope.

Login to post a reply

Server time is: 2024-11-27 04:54:13
Your offset time is: 2024-11-27 04:54:13