[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

Here is an example of a line of code I have
get_rgb (pixel, & red, & green, & blue);  
               if (blue<201)

I want to use the following colors as well (aside from plain red green and blue)"
orange
yellow
pink

is there some combination or do is it impossible. if you are one of those people that need more to understand. i need more colours to use with collisions.
werg

SplinterGU

#1
If I understand, you want get a copy of a graphic but in one solid color, it's true?

If it's, you can use blendop_tine


  int bop;

...

  bop=blendop_new();

  blendop_tint(bop,1.00,0,0,255);
  blendop_assign(file,graph,bop);




blendop functions only works with 16bits.


EDIT: maybe you don't mean it... :D
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

MisterN

#2
blue, mask area (cant run through it)
red, death
green, next level (but you warp to yellows location)
yellow, previous level (but you warp to greens location)

for now. can you help me with the warp code? i guess to maintain the left and right facing i can make a global variable that is attached to the character so when you go to the previous level you arent facing the default right. hmm.....

its gonna get very hard once i get to placing everything in the level. i wish i could make a code that makes the level load a .txt file (or something) and it knows the placements of everything) when that level loads in game. is that too hard? to me im thinking its just more code for the game but its not in the engine itself. but you are the fenix/bennu master.
werg

SplinterGU

sorry, my english is very poor... I don't understand that you ask.

please, if any people can translate it, I'll be thankfull
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

MisterN

Quote from: SplinterGU on June 15, 2011, 02:09:34 AM
sorry, my english is very poor... I don't understand what you are asking.

please, if anybody can translate it, I'll be thankfull

fixed

via google translator i have recieved the following

azul, la máscara de área (no puedo circular por él)
la muerte roja,
nivel verde, al lado (pero la deformación a la ubicación de los amarillos)
nivel amarillo, anterior (pero la deformación a la ubicación de los verdes)

por ahora. ¿me pueden ayudar con el código de la deformación? Supongo que para mantener la i la izquierda y la derecha frente puede hacer que una variable global que se adjunta con el carácter de modo que cuando usted va a alcanzar el nivel que arent hacia la derecha por defecto. hmm .....

su ir a ser muy difícil una vez que llego a poner todo en el nivel. Me gustaría poder hacer un código que hace que el nivel de carga un archivo. txt (o algo así) y sabe las ubicaciones de todo) que se carga cuando el nivel en el juego. es que demasiado duro? me estoy pensando en su código más justo para el juego pero no es en el propio motor. pero usted es el fenix / gurú de Bennu.
werg

SplinterGU

:)

I was use google translate, but I don't understand.

I think that you need check when your pixel is yellow, if you need it, then you need know what values return rgb for yellow.

but, maybe I understand bad.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

MisterN

your english has gotten worse :/ you mean add a red and green like

blue=200,red=200,green=200 (white) that kind of thing?
werg

SplinterGU

sorry, I don't understand you... please do not be offended, I do not understand what you say... I can't help you for now, I don't understand that you ask.

I really sorry, please, anybody can help here?
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

I mean


rgb(pixel,&r,&g,&b);

if ( r == 255 && g == 255 && b == 0 ) then "I have collision with yellow"
if ( r == 255 && g == 255 && b == 255 ) Then I have collision with white
if ( r == g && b < r ) then I have some yellow hue


I don't understand if you ask it.

here you have some rgb colors codes

http://www.avaloncity.com/info/fprefect/spice/colors.htm

well, maybe I wrong and you ask other thing.

sorry if I wrong.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Windgate

I think he wants to use a map with diferent colors in order to save info about the stage:

blue, mask area (cant run through it)
red, death
green, next level (but you warp to yellows location)
yellow, previous level (but you warp to greens location)

In that case, you must save that map in your fpg, and you can check colors by using map_get_pixel. That function returns the color on a x,y position.

Is this what you wanted to do? :P
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

MisterN

the mask has different colors. take for example the metroid fusion debug room. youll see that the dark blue you cant run into but you can run on it (which is blue in my map). in the debug room red is the ladder, i wont have a ladder in my game but i think you understand.
http://www.youtube.com/watch?v=1ZyD9Z3jYfA
werg

gecko

I think you're talkting about hardness maps.

What you have to do in that case is use a graphic to display in-game and another with the colors of surfaces, like you said, ladders, walls, and floors that will not be visible by the player.

And then, like Windgate said, check the colour of the second map (the one with the coloured zones) using map_get_pixel function.
Torres Baldi Studio
http://torresbaldi.com

BlackCurtain

What I do is simply count the position of the color index I want in the palette. You can view the palette in a fpg editor. A little primitive, I know.

MisterN

ok now that we have colors aside, how can i make it so the player warps to a specific color. the green and yellow will onyl be 1 32x32 block respectively so it wont be that confusing to have it warp to a point. but i would like to know how to make it warp to that point. and can someone also teach me how to make a level load a .txt file that is basically more code for that level (the locations of objects). i assume in total this is just a few lines.
werg

Outlaw

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!
"Life is cheap when the bounty is high"