Actually, C++ doesn't draw at all on it's own. It can print to the console, but that's really it. You need to use OpenGL, or another graphics library for drawing. I'm using the graphics library of SFML for my sprites. I'm just packaging my position and other variable updates with the drawing functions because they both happen right at the end of my main loop, and they happen in a consistent sequence. It's mostly possible because SFML greatly simplifies drawing sprites. WindowName.Draw(DrawableThing) is all it is.
The data for positions and things are kept in a Sprite class who's texture is defined at the start of the program by a Texture class. It's a little odd to work with at times, but I'm getting used to it.
I'm actually getting close to finishing all the basic procedures for drawing and moving many instances. I took a page out of your book and inverted my characters array so that it starts at the top, and works down to the 0 position. I don't know how well that'll work once I start dynamically allocating memory to the array, but for a preset max number of instances, it's great. If I have to invert it again later on, it's only a few lines I have to edit, so it's not a really big deal.
I have a player who can be moved left and right, and he flips on the X Axis to face the direction he's moving. Characters have SpeedPulse() function that this character is using for the Space key as a jump, but I don't have collisions yet, so there isn't gravity either. So he just flies up.
After this update and drawing portion is done, the next big steps are collisions, player controls and world navigation, and then some basic AI. I'm sure little things will pop up often that will be important too, but those are the big ones. I just have to make sure that I remember to make a mirror of the character system for the items too since those two instances have separate classes
And yeah, we produce lots of walls of text.
Code: Select all
<o> <3 Code