[Wip] Bomb jhon

Started by Zip, February 08, 2011, 07:30:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zip

i have seen the source of bombjack in div,:
the gravity control is in a separate process

in mine is implemented in the control of the jack...

that's the problem?

and i see 2 feature that i dont know:

1)the function
fade_on() e fade_off

and
2) father

what it is stand for?
what is the utilise?

FreeYourMind

fade_on(), fade_of() do a color fade effect on the screen (black to white).
(in bennu you need while(fade) frame; end to see the effect)

father is the parent process who has called the actual process (is the father os your process, your process is the son xD)
Whis this you can controle and read variables from this parent process.

handsource-dyko

Father (parent) and son (child) relationships between processes are one of the most powerfull features in the bennu language.
Also, adjecent processes that are instantiated (created by) the father process get bigbrother and smallbrother relations. This is very handy, as this reflects a list/tree structure. (You can use or abuse this to do very sophisticated things like emulating a linked list!)  Processes with these relationships can access each others local variables. You've mentioned that your gravity handling code is the player process, but in some example it is handled by a seperate process. In this case, your player process should instantiate th gravity process (wich becomes the son of the player). You can look on the wiki for some examples or have a look at the malvado source code.  ;)

Zip

Quote from: FreeYourMind on February 15, 2011, 12:54:28 PM
fade_on(), fade_of() do a color fade effect on the screen (black to white).
(in bennu you need while(fade) frame; end to see the effect)
is like a animation? as the italian: "dissolvenza"  right?
Quote from: handsource-dyko on February 15, 2011, 03:31:47 PM
Father (parent) and son (child) relationships between processes are one of the most powerfull features in the bennu language.
Also, adjecent processes that are instantiated (created by) the father process get bigbrother and smallbrother relations. This is very handy, as this reflects a list/tree structure. (You can use or abuse this to do very sophisticated things like emulating a linked list!)  Processes with these relationships can access each others local variables. You've mentioned that your gravity handling code is the player process, but in some example it is handled by a seperate process. In this case, your player process should instantiate th gravity process (wich becomes the son of the player). You can look on the wiki for some examples or have a look at the malvado source code.  ;)

thanx so much i need to test much example to understand completly that feature  :-[

i think i'll remake the control of gravity in a separated process :(
when i learn about father etc..

fade is optionaly  right?

handsource-dyko

Fading is totally optional. Generally it used for making nice transitions from loading screens to game screen etc.

Also, in the bennupack you will also find various examples of process interaction (look in the the 1 basic/basicsamples3 directory for "sons father brothers1.prg / sons father brothers2.prg"). Or look at these wiki articles: http://wiki.bennugd.org/index.php?title=Father, http://wiki.bennugd.org/index.php?title=Process.

Zip

i'v seen the example,
but i cant see the effect,
like:

father =1

son = father+1

son = 2

i've just see the family hierarchy
in the example with the circles from 1 to 4,
cant see relationships effect, if put a condition..

Drumpi

You're doing it wrong:

You MUST'N change the FATHER or SON variable, but their locals variables, like FATHER.X, SON.GRAPH, etc...
FATHER is a predefined local variable who gets the process id who invoqued the actual process, to easy access to it's locals variables.

father=1 has no sense, but break the tree hierachy. Be carefull.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

handsource-dyko

Each process is assigned a unique identification code by bennu's process scheduler, wich is stored in the local variable id.
You should see this is a read-only value. I recommend compiling your program with the debug console enabled, then when the program is running, hit alt-c. Now the debug console appears, and you can list all the active processes by hitting F2. You will see that each unique process instance has it's own number. This number is the local id value. Now you can check other local and private data of any process instance by using this number. So, if your player process has the id code 65888, you can now type 65888.x to show the value of it's x.

Obviously, you could also type 65888.id, this will read 65888.id=65888. You can also change values by using id's, so let's say you want to manipulate something for debugging purposes, you could type 65888.x=300, this will chang your player's x-value. Just don't try to change the id value. Also, you can store the value of some other process in the current process with the use of the collision function. (Collision always returns an id code).

Zip

I'm sad, but for now the project is abandoned  :'( , if someone wants to continue it can get the source I posted before.
Obviously if someone is continuing the development of the game tell me =)