[FENIX] more colors

Started by MisterN, June 15, 2011, 12:31:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MisterN

Ok... ive already completed the game controls for items, the menu, the enemies, etc. i just have no idea how to do the .txt file thing.  dont be rude and help me witht hat part at least.
werg

SplinterGU

#16
If you need collision with some objects (process?) and with other not, you only need add a type (a local var) for the object_type, and then when you collision with it, check this var and do what you want depending the value of this var.

i mean,

#define hard_block 1
#define soft_block 2
#define lalal          999

local
obj_type;

...

obj_type = hard_block;

...

obj_type = soft_block;

...

obj_type = lala;

...

when you have collision

if ( collision_id.obj_type == ... )
...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

BlackCurtain

Quote from: Outlaw on June 16, 2011, 02:47:57 PM
How about we make the game for you? Just joking! Lol... The fun part of being a programmer is finding out how to solve different problems you come across in order to make the game or the program you want to make. If you ask us about everything you're missing the meaning of it all. So, my suggestion is: read different ways to do what you want to do and then CODE IT and then LEARN IT, doing that it'll help you become a true game programmer, and a better one with each step you take, don't be a lamer! Keep up with you work! Cheers!
Agree.
Most of what I've learned about Bennu I've read in the documentation. And the majority of the pages there only has vague descriptions.

MisterN

#18
well im not like my brain cannot process vague things. just show me a warp code and a way to have a level read a .txt file for where everything is placed for the love of god (or alla or cthulu or buddha whatever your preference is...). the game is virtually done, i just done know warping and the level reading stuff.
werg

SplinterGU

for read a txt file, you can use fopen, fgets, and fclose.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Outlaw

I'm not being rude DoctorN, I apologyze if that was your thought about what I said, but essencially that is the way of the game programmer. I have to say that I can't quite understand what is your purpose with that thing of txt files and level uploader. Maybe you could explain yourself better, maybe also add some graphs to help illustrate your request, so that way more people will be able to help you out. Cheers!
"Life is cheap when the bounty is high"

MisterN

the .txt file will contain code of where everything is placed in that level (so the levels image, the levels mask, the itmes, the characters warp point, the character, the enemies, etc). that way it wont be in the engine. now id like to make this a moddable engine (much like with the source sdk, not exactly but along the lines of what they do). i want it so the game engine itself has all the information about all the things running in the game. if i could, i want the engine to load a .txt file (the level structure) that has all the levels in it and that .txt file loads more .txt files (the levels)
werg

gecko

Maybe you could use INI files for the maps, i don't if this would be ok, but you can have the list of the objects, and then load it into an array, or something...

To read ini files check this: http://forum.bennugd.org/index.php?topic=2317.0
Torres Baldi Studio
http://torresbaldi.com

MisterN

will it work on fenix? until dc-swat ( a russian guy) ports bennu to the dreamcast (which hes working on, it keeps crashing though) im stuck with fneix.
werg

SplinterGU

please, if you need help for fenix, please, remember us it.

in the post title, add [FENIX]

because the solutions can be very differents.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

MisterN

#25

Process scroller(STRING ".\sprites\level\image\level1.txt")
   int handle;   // handle for the loaded file
   int druppels; // here's where the loaded data go
Begin

level_graph=fopen(".\sprites\level\image\level1.txt",O_READ); // opens the file in reading mode
   fread(handle,druppels);        // reads from the file and puts the data in druppels
   fclose(handle);                // zipping up after business is done
   write(0,0,0,0,druppels);       // shows the value of druppels

start_scroll(0,Player_graph,level_graph,0,0,1);//starts the scroll


im confused... am I doing this right? in the text file i just put


level_graph=load_png(".\sprites\level\image\testlevel-1.png");
end


EDIT:
Process scroller ()
Private

    int handle;   // handle for the loaded file
    int druppels; // here's where the loaded data go

Begin

handle=fopen(".\sprites\level\image\level1.txt",O_READ); // opens the file in reading mode
    fread(handle,druppels);        // reads from the file and puts the data in druppels
    fclose(handle);                // zipping up after business is done
    write(0,0,0,0,druppels);       // shows the value of druppels

start_scroll(0,Player_graph,level_graph,0,0,1);//starts the scroll,


Now it loads the game but crashes right after the window appears
werg

MisterN

The modify button disappeared for me :/ so I cant really add it into the other post but the error i am getting when it opens and then closes is:
El fondo de scroll 0:0 no existe
werg

MisterN

any second now... i spent all week trying out things but nothing worked :/
werg

Sandman

It says the front graphic if the scroll doesn't exist. You got to fix that.
-- Sandman

MisterN

How would i fix that though? Do you need the part of my code?
Process scroller ()
Private

    int handle;   // handle for the loaded file
    int level; // here's where the loaded data go

Begin

handle=fopen(".\sprites\level\image\level1.txt",O_READ); // opens the file in reading mode
    fread(handle,level);        // reads from the file and puts the data in level
fclose(handle);                // zipping up after business is done
    write(0,0,0,0,level);       // shows the value of level
start_scroll(0,Player_graph,level_graph,0,0,1);//starts the scroll, variables:
werg