Upcoming RPG
Upcoming RPG
I've caught up on the tutorials and with the release of the new tutorial, I have most of the materials to make an RPG. I'm waiting the transparency vid, because I tried to improvise, and well, this happened.
You can enter buildings and move to new areas by touching the edge, use wasd to move by the way.
You can enter buildings and move to new areas by touching the edge, use wasd to move by the way.
- Attachments
-
- RPG_Crap.zip
- (201.71 KiB) Downloaded 144 times
-
- Yes, This Happened.PNG
- (18.9 KiB) Not downloaded yet
Last edited by goldengamesTM on August 22nd, 2017, 3:51 pm, edited 2 times in total.
Re: Upcoming RPG
I'm an idiot and forgot to add the file the correct file the first time.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Upcoming RPG
It appears you are wanting to use something called chroma key, or color key transparency. Since chili's color class has getters for the different color channels, why not loop through the sprite and if color == color key value skip it.
Just make a new DrawSprite function in Graphics.
Just make a new DrawSprite function in Graphics.
Code: Select all
void DrawSprite( int xOffset, int yOffset, Surface &Surf, Color Key )
{
const unsigned char keyred = Key.GetR();
const unsigned char keygrn = Key.GetG();
const unsigned char keyblu = Key.GetB();
for(int y = 0; y < Surf.GetHeight(); ++y)
{
for(int x = 0; x < Surf.GetWidth(); ++x)
{
const pixel = Surf.GetPixel(x, y);
if(!(pixel.GetR() == keyred && pixel.GetG() == keygrn && pixel.GetB() == keyblu))
{
PutPixel(x + xOffset, y + yOffset, pixel);
}
}
}
}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Upcoming RPG
Pretty much exactly what I do in Intermediate 11, except I add ==, != operators to Color.
RPG game sounds fun, hope to see some progress! I11 will add drawing subregions, clipping, chroma
I12 is about animated sprites, and I13 will be about drawing text. Should all be useful for you project.
RPG game sounds fun, hope to see some progress! I11 will add drawing subregions, clipping, chroma
I12 is about animated sprites, and I13 will be about drawing text. Should all be useful for you project.
Chili
Re: Upcoming RPG
You project?chili wrote:and I13 will be about drawing text. Should all be useful for you project.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Upcoming RPG
^^Trollin' Chili?
lol
lol
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Upcoming RPG
Thanks Albinopapa! I had to do some tweaking to your code to get it to work, but hey man, it works!
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Upcoming RPG
Good deal.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 19
- Joined: July 17th, 2017, 1:24 pm
Re: Upcoming RPG
Nice idea, I like how you did the other areas to go to though I did get lost for a second. I think I played the version without the chroma key thing but much cool.