Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Nov 2012
Offline Last Active Oct 26 2014 06:12 PM

#5046071 Art skill learning?

Posted by on 23 March 2013 - 04:38 PM

How to learn art is a pretty big question. If you want to learn by "teaching yourself" then I suggest getting books on the basics.

And when you feel a bit more comfortable with your drawing skills maybe you could check out the gnomon workshop. 

They have very good dvds, pretty expensive but very good. Tho you should probably not jump right into them if you lack the basics.


But most importantly: practice, practice and more practice like with most skills in life.


Hope this helps in some way.


Oh, and a school is good because it forces you to practice, you can't slack because then you wont pass the tests.

#5038401 Game: Health regeneration?

Posted by on 02 March 2013 - 06:31 AM

Thank you all for your input. I finally with your help got it working. :)

#5038173 Game: Health regeneration?

Posted by on 01 March 2013 - 04:31 PM


So I've been working on a health bar which shrinks and grows according to how much health your character has.

The problem is I don't know how to add a smooth increment to health regen. 

Say if I want to gain 600 life over 4 seconds, how would I go about achieving this? Will I have to use float numbers, and in what way? The health bar checks how many pixels the bar should shrink and grow depending on the health value.


This is my code right now.


void CHealthBar::OnRender(SDL_Surface* _destination)

	SDL_FillRect(_destination, &BarBackground, SDL_MapRGB(_destination->format, 0, 0, 0));

	if( (float)Owner->GetCurrentHealth() / Owner->GetMaxHealth() > 0.6f )
		SDL_FillRect(_destination, &Bar, SDL_MapRGB(_destination->format, HighHealth.r, HighHealth.g, HighHealth.b));
	if ( (float)Owner->GetCurrentHealth() / Owner->GetMaxHealth() <= 0.6f && Owner->GetCurrentHealth() / Owner->GetMaxHealth() < 0.25f )
		SDL_FillRect(_destination, &Bar, SDL_MapRGB(_destination->format, AverageHealth.r, AverageHealth.g, AverageHealth.b)); 
	if( (float)Owner->GetCurrentHealth() / Owner->GetMaxHealth() <= 0.25f)
		SDL_FillRect(_destination, &Bar, SDL_MapRGB(_destination->format, LowHealth.r, LowHealth.g, LowHealth.b)); 

void CHealthBar::OnLoop()

	BarBackground.x = Owner->GetX();
	BarBackground.y = ( Owner->GetY() - 5 ); 

	Bar.x = ( Owner->GetX() + 1 );
	Bar.y = ( Owner->GetY() - 4 );

	float tempw = (float)Owner->GetCurrentHealth() / Owner->GetMaxHealth();
	Bar.w = MaxBarLength * tempw;



Would be great if someone could give a good answer on this.

#5020666 How to create minimap? (sdl/opengl)

Posted by on 12 January 2013 - 05:57 AM

I have really no idea, but I would think that you translate each tile into a pixel on the "minimap".

That's the idea. Just no idea how

Well maybe you can figure it out if you read some SDL about pixel manipulation. And let's hope someone qualified shows up in here :P good luck

#5020662 How to create minimap? (sdl/opengl)

Posted by on 12 January 2013 - 05:44 AM

I have really no idea, but I would think that you translate each tile into a pixel on the "minimap".

#5004050 Stuck on newbie project

Posted by on 25 November 2012 - 06:10 PM


I've been working on a little project for a while now, It´s my first SDL project. I started the project to force me to look things up and keep me learning while having fun.
Now I've been stuck many times during this project on things I never thought I would manage to solve, yet later I did.

However, this time I feel stuck and I don´t know how to proceed, this time it´s more about problem solving.
So I can´t just start looking around for new feats to use in c++ and get by in that way, I just don´t know how the problem should
be solved and with what.

The project is from the beginning based on the tutorial series on sdltutorials. I then built upon it, adding asset manager, different sized frames in animations, tile layers, windows with buttons etc.

Being able to do these things made me really happy, even tho I have no clue if they are implemented in a good or bad fashion.

The problems I have now are things like:
How would I add slopes as tiles (this looks to be very hard, atleast for me) and how much would I have to change the way the tiles work overall.
How much I would have to change my now lacking physics,
And much more stuff.

So my question is, now that I am stuck and starting to be bored of being stuck.
Should I focus on something else or keep with the project trying to solve things I just can´t fathom?
And if you wan´t to comment about anything in the video, feel free to. If you see something that looks awful.


Here´s a short video of my project: